Answers.Body: <p>Preferably, you'll want to dig into your outgoing mail service logs. How you do that depends on how you've setup civimail. It might be as simple as inspecting a file like /var/log/mail on your server, or it might involve something more complicated if you're using a remote outgoing mail service.</p>
  
  <p>The challenge is to figure out which part of the mailing process is generating multiple mails. Typically this would occur where one server is passing off the mail to another server, and it's being received but not acknowledged, so the first server tries again later. A bad firewall, or misconfigured server along the way, for example. This would show up with the multiple mails having different receive times.</p>
  
  <p>If you don't have access to your maillogs, inspecting the raw mail headers of the received mail may show some clues (e.g. warnings by one or more of the servers that are handling your mail).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-29T01:25:06.217Z
Answers.Text: The mail log (var/log/mail) does show multiple distinct emails.   The only ones that are duplicated are those from CiviMail.  (Emails sent via Drupal rules, for example, are processed correctly and only show up a single time.)   Changing from SMTP to SendMail has the same results. SMTP service shows receipt of the multiple emails.  I am stalled at figuring out what Civi process is sending the multiple emails and how it might be configured.   Not aware of any changes to our configuration between 4.7.7 and 4.7.8 when problem started.
Answers.UserDisplayName: Dave T
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-29T18:29:38.787Z
Answers.Text: Fascinating ...  though I'm not convinced your case has the same origin as the original report. For example - your case seems to be specific to running tests and a limited number of recipient addresses. Mails going out via CiviMail do have some unusual headers compared with Drupal rules, but it does seem like it's the CiviMail code that for whatever reason is quitting after sending the mail off but before identifying it as sent.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-28T21:42:10.680Z
Answers.LastActivityDate: 2016-06-28T21:42:10.680Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>I have the same issue with Drupal7/4.7.8 immediately after upgrade for a list of about 9700 - most recipients get the one message intended, a minority received 80+ duplicates.
  The evidence in the logs seems to indicate a civimail issue as each duplicate has a new postfix, amavis and civimail uid (is it verp?, sorry seems not allowed to post the example - long string of digits &amp; hex @domain.org. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-14T00:13:29.697Z
Answers.Text: An update. Some mailings affected others not. Those that are affected also have problems sending a draft mailing to some email addresses. Tried six addresses that come to me. One receives 12 copies, another two, the rest zero. The zeroes also give an error "Could not identify any recipients. Perhaps the group is empty?". Repetition produces exact same result for this mailing. For another mailing, same email addresses have no issues when sent drafts.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-19T02:23:53.413Z
Answers.Text: Upgrading to 4.7.9 made no difference. Noted that all the problematic mailings were created (but not all sent) by same user. However, some mailings created by that user OK. Created a duplicate mailing to one of the problem ones myself (ie. same html, options and groups). No problem with this one. Have deleted & re-added the user and will see what happens.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-28T03:03:02.440Z
Answers.Text: There is evidence that these problems are related to the use of Civi ACLs.  Specifically, if the user who is sending the bulk mail belongs to an ACL group, there is a problem with the query that selects the recipients for the mailing.
  
  Are you using ACL groups?   Is the sending user a member of an ACL group?
Answers.UserDisplayName: Dave T
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-05T02:25:02.513Z
Answers.Text: He was. The user that was mostly having this issue I deleted and recreated. New user not in ACL group. The problem doesn't seem to have reoccured.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-11T02:57:18.143Z
Answers.Text: The workaround for this (and the maybe related issue of 'no recipients') has been to reuse & edit old successful mailings.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T15:01:17.913Z
Answers.Text: Can you find a pattern with the minority that received the duplicates? Look for either patterns in the domain (e.g. something like all @aol.com addresses ...), and separately, look for patterns in the the id's of the corresponding contacts (e.g. all the contact ids greater than or less than some number, or perhaps the group membership ids).
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T17:44:32.447Z
Answers.Text: Have you seen any duplicates when sending test messages?
Answers.UserDisplayName: Dave T
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-01T00:30:24.410Z
Answers.Text: I have done some analysis. The domains are a wide range of private and commercial with no apparent pattern. The total Recipients from two groups was 9763. Only 5313 of these had email addresses, of which 882 are on hold. However, the mailing's report page shows 3232 intended & 4153 (128.50%) delivered. I have also analysed no. received based on ID that I am happy to share the data from. It shows that of those receiving min was two, max was 105. Many gaps & clusters by ID. Data here: [link](http://bit.ly/298Nppj) Have not seen duplicates with test messages.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-29T23:58:37.130Z
Answers.LastActivityDate: 2016-06-30T01:42:23.940Z
Answers.LastEditDate: 2016-06-30T01:42:23.940Z
Answers.UserDisplayName: Bryan
Body: <p>I use civimail on a drupal 7/CiviCRM 4.7.8 and have done so for many years.</p>
  
  <p>Recently civimail has started sending out an email multiple times to the same email address even though </p>
  
  <p>1) the email address only exists once in the system.</p>
  
  <p>2) In the sql database under civicrm_mailing_recipients it only says the email contact receives it once and this is borne out in the activities tab.</p>
  
  <p>This is not just happening with one email address - it's happening with hundreds of email addresses.</p>
  
  <p>Any ideas on where to start troubleshooting?</p>
  
  <p>Thanks
  Caroline</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-28T17:45:56.730Z
Comments.Text: I have this same issue.    Had to rollback to 4.7.7 to stop.   Reported as CRM-18955
Comments.UserDisplayName: Dave T
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-28T20:01:46.830Z
Comments.Text: I had this same problem with 4.6 with some users receiving 6/7 of the same email.  The cause of problem was that we had moved to a different shared server and there was a problem with cron that was causing the email queue to be restarted over & over again.  I  resolved the problem by 1) fixing the problem with cron 2) cancelled the mailings that were still running
Comments.UserDisplayName: Andy Clark
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-28T20:13:05.393Z
Comments.Text: My issue occurs with test messages as well as full broadcasts.  I didn't think that cron would have a role in test messages.  And the messages just keep coming from the test triggers.   Caroline B - do you have the problem with test messages as well?
Comments.UserDisplayName: Dave T
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-29T19:36:30.970Z
Comments.Text: No test mails are fine for me - I'm going to look at the logs I think
Comments.UserDisplayName: Caroline B
Tags: <civimail>
Title: civimail sending email multiple times
ThreadText: # civimail sending email multiple times
  
  (Asked by: username_0 on 2016-06-27)
  
  I use civimail on a drupal 7/CiviCRM 4.7.8 and have done so for many years.
  
  Recently civimail has started sending out an email multiple times to the same email address even though
  
  1) the email address only exists once in the system.
  
  2) In the sql database under civicrm\_mailing\_recipients it only says the email contact receives it once and this is borne out in the activities tab.
  
  This is not just happening with one email address - it's happening with hundreds of email addresses.
  
  Any ideas on where to start troubleshooting?
  
  Thanks
  username_0
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: I have this same issue.    Had to rollback to 4.7.7 to stop.   Reported as CRM-18955  
  > **username_2**: I had this same problem with 4.6 with some users receiving 6/7 of the same email.  The cause of problem was that we had moved to a different shared server and there was a problem with cron that was causing the email queue to be restarted over & over again.  I  resolved the problem by 1) fixing the problem with cron 2) cancelled the mailings that were still running  
  > **username_1**: My issue occurs with test messages as well as full broadcasts.  I didn't think that cron would have a role in test messages.  And the messages just keep coming from the test triggers.   username_0 B - do you have the problem with test messages as well?  
  > **username_0**: No test mails are fine for me - I'm going to look at the logs I think  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2016-06-28. Score: 1
  
  Preferably, you'll want to dig into your outgoing mail service logs. How you do that depends on how you've setup civimail. It might be as simple as inspecting a file like /var/log/mail on your server, or it might involve something more complicated if you're using a remote outgoing mail service.
  
  The challenge is to figure out which part of the mailing process is generating multiple mails. Typically this would occur where one server is passing off the mail to another server, and it's being received but not acknowledged, so the first server tries again later. A bad firewall, or misconfigured server along the way, for example. This would show up with the multiple mails having different receive times.
  
  If you don't have access to your maillogs, inspecting the raw mail headers of the received mail may show some clues (e.g. warnings by one or more of the servers that are handling your mail).
  
  > **Comments:**
  > **username_1**: The mail log (var/log/mail) does show multiple distinct emails.   The only ones that are duplicated are those from CiviMail.  (Emails sent via Drupal rules, for example, are processed correctly and only show up a single time.)   Changing from SMTP to SendMail has the same results. SMTP service shows receipt of the multiple emails.  I am stalled at figuring out what Civi process is sending the multiple emails and how it might be configured.   Not aware of any changes to our configuration between 4.7.7 and 4.7.8 when problem started.  
  > **username_3**: Fascinating ...  though I'm not convinced your case has the same origin as the original report. For example - your case seems to be specific to running tests and a limited number of recipient addresses. Mails going out via CiviMail do have some unusual headers compared with Drupal rules, but it does seem like it's the CiviMail code that for whatever reason is quitting after sending the mail off but before identifying it as sent.  
  
  ---
  
  ### Answer by username_4 on 2016-06-29. Score: 0
  
  I have the same issue with Drupal7/4.7.8 immediately after upgrade for a list of about 9700 - most recipients get the one message intended, a minority received 80+ duplicates.
  The evidence in the logs seems to indicate a civimail issue as each duplicate has a new postfix, amavis and civimail uid (is it verp?, sorry seems not allowed to post the example - long string of digits & hex @domain.org.
  
  > **Comments:**
  > **username_3**: Can you find a pattern with the minority that received the duplicates? Look for either patterns in the domain (e.g. something like all @aol.com addresses ...), and separately, look for patterns in the the id's of the corresponding contacts (e.g. all the contact ids greater than or less than some number, or perhaps the group membership ids).  
  > **username_1**: Have you seen any duplicates when sending test messages?  
  > **username_4**: I have done some analysis. The domains are a wide range of private and commercial with no apparent pattern. The total Recipients from two groups was 9763. Only 5313 of these had email addresses, of which 882 are on hold. However, the mailing's report page shows 3232 intended & 4153 (128.50%) delivered. I have also analysed no. received based on ID that I am happy to share the data from. It shows that of those receiving min was two, max was 105. Many gaps & clusters by ID. Data here: [link](http://bit.ly/298Nppj) Have not seen duplicates with test messages.  
  > **username_4**: An update. Some mailings affected others not. Those that are affected also have problems sending a draft mailing to some email addresses. Tried six addresses that come to me. One receives 12 copies, another two, the rest zero. The zeroes also give an error "Could not identify any recipients. Perhaps the group is empty?". Repetition produces exact same result for this mailing. For another mailing, same email addresses have no issues when sent drafts.  
  > **username_4**: Upgrading to 4.7.9 made no difference. Noted that all the problematic mailings were created (but not all sent) by same user. However, some mailings created by that user OK. Created a duplicate mailing to one of the problem ones myself (ie. same html, options and groups). No problem with this one. Have deleted & re-added the user and will see what happens.  
  > **username_1**: There is evidence that these problems are related to the use of Civi ACLs.  Specifically, if the user who is sending the bulk mail belongs to an ACL group, there is a problem with the query that selects the recipients for the mailing.  Are you using ACL groups?   Is the sending user a member of an ACL group?  
  > **username_4**: He was. The user that was mostly having this issue I deleted and recreated. New user not in ACL group. The problem doesn't seem to have reoccured.  
  > **username_4**: The workaround for this (and the maybe related issue of 'no recipients') has been to reuse & edit old successful mailings.  
  
  ---
  
  