Answers.Body: <p>Some pointers on how to debug this a bit further. Links are to the CiviCRM demo site - visit <a href="http://dmaster.demo.civicrm.org/" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/</a> and log in. (WordPress / Joomla URLs will differ.)</p>
  
  <h1>Check output of "Send Scheduled Mailings" scheduled task.</h1>
  
  <ul>
  <li><a href="http://dmaster.demo.civicrm.org/civicrm/admin/job?reset=1" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/civicrm/admin/job?reset=1</a></li>
  </ul>
  
  <p>This is the task which delivers CiviMail messages. It's executed from cron regularly, and there's a log visible at the URL above ("View job log" for "Send scheduled mailings"). Check if there's any output there. (If there are no job log messages, it's not getting executed!)</p>
  
  <h1>Check your <code>cron</code> setup</h1>
  
  <ul>
  <li><a href="https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#setting-up-the-cron-job" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#setting-up-the-cron-job</a></li>
  </ul>
  
  <p>CiviCRM and CiviMail depend on <code>cron</code> - scheduled jobs triggered by the system. A single CiviMail may take several <code>cron</code> runs to deliver all the emails. This task should be executed by the system somehow. The task will be run in the console and may generate output (success or failure). It should be executed as the webserver user for filesystem permissions, and ideally set up to capture output so you can investigate if it's not working as expected.</p>
  
  <h1>Investigate your mailserver logs</h1>
  
  <p>Use <code>tail</code> / <code>grep</code> etc to observe the mailserver logs and see which addresses get messages queued for them. It sounds like you've already established that the missing messages never get there, but worth including in this list.</p>
  
  <h1>Get support</h1>
  
  <ul>
  <li><a href="https://www.civicrm.org/partners" rel="nofollow noreferrer">Professional support</a></li>
  <li><a href="https://chat.civicrm.org" rel="nofollow noreferrer">Community support via chat</a></li>
  <li>You can link to your question here to save explaining over!</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-05-01T11:07:10.353Z
Answers.Text: This isn't really an answer, but comment formatting would have been painful.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-05-01T21:53:15.633Z
Answers.Text: It answers "Is there somewhere I can look to find some error?"
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-05-01T11:06:32.817Z
Answers.LastActivityDate: 2018-05-01T11:06:32.817Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>I'd also recommend looking at from a slightly naive point of view - i.e. what was special about this mailing from your other mailings? and secondly, see if you can identify which of the recipients didn't get it and find out if there is a pattern. You can do this with fancy advanced search stuff, for example.</p>
  
  <p>Another useful log that Chris didn't mention is the CiviCRM error log, which sometimes has useful entries. Actually, I'd look in this first (either manually or using <a href="https://civicrm.org/extensions/civicrm-log-viewer" rel="nofollow noreferrer">https://civicrm.org/extensions/civicrm-log-viewer</a>).</p>
  
  <p>I agree it does look to be an unexpected error that CiviCRM isn't handling properly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-02T21:13:26.003Z
Answers.LastActivityDate: 2018-05-02T21:13:26.003Z
Answers.UserDisplayName: Alan Dixon
Body: <p>We had a mailing go out to 231 recipients, and it completed within the same minute it started.  Looking at the report today, it shows that only 131 were successfully sent, the others all show as "unknown."  I looked into /var/log/mail.log and can confirm that I don't see any lines of trying to send mail for those contacts that show as unknown.  I also see records in the civicrm_mailing_event_queue table for what I believe are the same contact_ids that are unknown.  Not sure that is related.</p>
  
  <p>CiviCRM is set up to use the standard php mail() function.</p>
  
  <p>I'm at a loss of even where to look for the issue.  It just seems like CiviMail stop trying to send or something.  Is there somewhere I can look to find some error?  Some kind of limit we reached?</p>
  
  <p><a href="https://i.sstatic.net/NkEh9.png" rel="noreferrer"><img src="https://i.sstatic.net/NkEh9.png" alt="mail status"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-28T09:21:33.037Z
Comments.Text: What is your set up. Could it be some limit by a hosting provider?
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-28T12:33:49.213Z
Comments.Text: We're on a Linode VPS with Ubuntu 16.04.4. I don't know of any limits for mail that we've put in ourselves.  And what's funny is it looks like it's CiviCRM itself that isn't even trying to send it, as there is no reference to the mail in /var/log/mail.log.  Is there some type of default limit in ubuntu?  More importantly, wouldn't Civi at least try and then send out an error?
Comments.UserDisplayName: Paul B
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-29T02:46:25.533Z
Comments.Text: It could be a limit in the php.ini or other server settings regarding how long a script can run. By default, those settings tend to be quite low. I don't think you would see an error, as it's expected that you'd just run the script again to finish it off.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-29T12:51:52.883Z
Comments.Text: That is an interesting thing to look at. Ours was set to 150 seconds (2.5 minutes), which I have doubled. However, Civi tells me it completed in less than 1 minute. So I still have a feeling the issue might be with Civi itself.
Comments.UserDisplayName: Paul B
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-29T20:38:41.413Z
Comments.Text: Suggest reviewing the emails which did and didn't deliver for patterns. Are the failed emails all from a couple of mail providers? Are the successful ones those which would be sent first if sorted alphabetically? Etc.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-30T13:50:43.250Z
Comments.Text: Chris, I tried to look for patterns, sorting by contact id, by name, by provider.  It's random - different contacts with various domains in their email.  Not alpha, not contact id sorted.  It's just as if Civi did nothing and gave no error.  I would love to get a resolution on this, this is baffling me and causing our admins to shy away from Civi for mailings, I don't want that.
Comments.UserDisplayName: Paul B
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-30T17:03:28.670Z
Comments.Text: Also, in case it helps others, we just tried to re-run the mailing for the 100 recipients who didn't receive it the first time.  Out of 100, Civi sent to exactly 70.  30 were not sent. Our admins are now telling me they don't want to use Civi for mailings, so it's become an issue. How can I escalate this?
Comments.UserDisplayName: Paul B
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-05-01T10:56:11.393Z
Comments.Text: I think your next steps to escalate this are to [seek professional assistance](https://www.civicrm.org/partners) (guessing you don't have any at present, or you'd already be escalating to them?) or to [ask for community support on chat](https://chat.civicrm.org). I'll add some pointers in an answer because I can format better there!
Comments.UserDisplayName: Chris Burgess
Tags: <civimail>
Title: CiviMail is only sending to half the recipients
ThreadText: # CiviMail is only sending to half the recipients
  
  (Asked by: username_0 on 2018-04-27)
  
  We had a mailing go out to 231 recipients, and it completed within the same minute it started. Looking at the report today, it shows that only 131 were successfully sent, the others all show as "unknown." I looked into /var/log/mail.log and can confirm that I don't see any lines of trying to send mail for those contacts that show as unknown. I also see records in the civicrm\_mailing\_event\_queue table for what I believe are the same contact\_ids that are unknown. Not sure that is related.
  
  CiviCRM is set up to use the standard php mail() function.
  
  I'm at a loss of even where to look for the issue. It just seems like CiviMail stop trying to send or something. Is there somewhere I can look to find some error? Some kind of limit we reached?
  
  [![mail status](https://i.sstatic.net/NkEh9.png)](https://i.sstatic.net/NkEh9.png)
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: What is your set up. Could it be some limit by a hosting provider?  
  > **username_0**: We're on a Linode VPS with Ubuntu 16.04.4. I don't know of any limits for mail that we've put in ourselves.  And what's funny is it looks like it's CiviCRM itself that isn't even trying to send it, as there is no reference to the mail in /var/log/mail.log.  Is there some type of default limit in ubuntu?  More importantly, wouldn't Civi at least try and then send out an error?  
  > **username_2**: It could be a limit in the php.ini or other server settings regarding how long a script can run. By default, those settings tend to be quite low. I don't think you would see an error, as it's expected that you'd just run the script again to finish it off.  
  > **username_0**: That is an interesting thing to look at. Ours was set to 150 seconds (2.5 minutes), which I have doubled. However, Civi tells me it completed in less than 1 minute. So I still have a feeling the issue might be with Civi itself.  
  > **username_3**: Suggest reviewing the emails which did and didn't deliver for patterns. Are the failed emails all from a couple of mail providers? Are the successful ones those which would be sent first if sorted alphabetically? Etc.  
  > **username_0**: Chris, I tried to look for patterns, sorting by contact id, by name, by provider.  It's random - different contacts with various domains in their email.  Not alpha, not contact id sorted.  It's just as if Civi did nothing and gave no error.  I would love to get a resolution on this, this is baffling me and causing our admins to shy away from Civi for mailings, I don't want that.  
  > **username_0**: Also, in case it helps others, we just tried to re-run the mailing for the 100 recipients who didn't receive it the first time.  Out of 100, Civi sent to exactly 70.  30 were not sent. Our admins are now telling me they don't want to use Civi for mailings, so it's become an issue. How can I escalate this?  
  > **username_3**: I think your next steps to escalate this are to [seek professional assistance](https://www.civicrm.org/partners) (guessing you don't have any at present, or you'd already be escalating to them?) or to [ask for community support on chat](https://chat.civicrm.org). I'll add some pointers in an answer because I can format better there!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-05-01. Score: 1
  
  Some pointers on how to debug this a bit further. Links are to the CiviCRM demo site - visit <http://dmaster.demo.civicrm.org/> and log in. (WordPress / Joomla URLs will differ.)
  
  # Check output of "Send Scheduled Mailings" scheduled task.
  
  * <http://dmaster.demo.civicrm.org/civicrm/admin/job?reset=1>
  
  This is the task which delivers CiviMail messages. It's executed from cron regularly, and there's a log visible at the URL above ("View job log" for "Send scheduled mailings"). Check if there's any output there. (If there are no job log messages, it's not getting executed!)
  
  # Check your `cron` setup
  
  * <https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#setting-up-the-cron-job>
  
  CiviCRM and CiviMail depend on `cron` - scheduled jobs triggered by the system. A single CiviMail may take several `cron` runs to deliver all the emails. This task should be executed by the system somehow. The task will be run in the console and may generate output (success or failure). It should be executed as the webserver user for filesystem permissions, and ideally set up to capture output so you can investigate if it's not working as expected.
  
  # Investigate your mailserver logs
  
  Use `tail` / `grep` etc to observe the mailserver logs and see which addresses get messages queued for them. It sounds like you've already established that the missing messages never get there, but worth including in this list.
  
  # Get support
  
  * [Professional support](https://www.civicrm.org/partners)
  * [Community support via chat](https://chat.civicrm.org)
  * You can link to your question here to save explaining over!
  
  > **Comments:**
  > **username_3**: This isn't really an answer, but comment formatting would have been painful.  
  > **username_4**: It answers "Is there somewhere I can look to find some error?"  
  
  ---
  
  ### Answer by username_5 on 2018-05-02. Score: 0
  
  I'd also recommend looking at from a slightly naive point of view - i.e. what was special about this mailing from your other mailings? and secondly, see if you can identify which of the recipients didn't get it and find out if there is a pattern. You can do this with fancy advanced search stuff, for example.
  
  Another useful log that Chris didn't mention is the CiviCRM error log, which sometimes has useful entries. Actually, I'd look in this first (either manually or using <https://civicrm.org/extensions/civicrm-log-viewer>).
  
  I agree it does look to be an unexpected error that CiviCRM isn't handling properly.
  
  
  ---
  
  