Answers.Body: <p>As I've added to my question, it turns out the problem wasn't with the emails or the DND settings - the missing contacts all had a NULL value for is_deceased, and apparently CiviCRM interprets this as them being dead (rather than just missing information). When you edit the entire contact record, this is flagged, but because I was just checking the emails and DND settings in place, I hadn't noticed this.</p>
  
  <p>Setting all the null values to 0 fixed the problem - I ran the following SQL query on the civicrm_contact table:</p>
  
  <p>UPDATE civicrm_contact SET is_deceased = 0 WHERE is_deceased IS NULL;</p>
  
  <p>(As per the answer here: <a href="https://civicrm.stackexchange.com/a/7396/610">https://civicrm.stackexchange.com/a/7396/610</a> )</p>
  
  <p>Following that, all the relevant contact records reappeared in the mailing list recipient count.</p>
  
  <p>(Double checking the import field mapping, it turns out I didn't tell it to skip that field - CiviCRM exports the field as empty if is_deceased = 0, so I guess importing it did overwrite the existing values)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-04T14:46:41.383Z
Answers.LastActivityDate: 2018-09-04T14:46:41.383Z
Answers.UserDisplayName: liblogger
Answers.Body: <p>You have probably checked that already but you have to make sure that the contacts do not have a global opt out which is different from the subscription status of the group.</p>
  
  <p>Have a look at the opt out flag:
  <a href="https://i.sstatic.net/svo89.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/svo89.png" alt="Opt Out Setting"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-03T10:22:37.907Z
Answers.Text: No, they definitely aren't opted-out.
Answers.UserDisplayName: liblogger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-03T06:35:44.870Z
Answers.LastActivityDate: 2018-09-03T06:35:44.870Z
Answers.UserDisplayName: Fabian
Body: <p>I'm fairly sure I've worked out why this is happening, but want some input to confirm the problem, and hopefully pointers for fixing it.</p>
  
  <p>We totally refreshed our main mailing list in line with GDPR, so we've been mailing about 2000 people with only a handful of bounces and unsubscriptions; now suddenly with our latest mail out, CiviCRM is only finding half of these people. Looking at the group, they're still there, and only a dozen of these are on hold due to bounces. Anyone who unsubscribed isn't counted towards the group total, so that's not the issue. Checking for duplication, it's not that we accidentally created 1000 duplicate contacts, so that's not the issue.</p>
  
  <p>What has happened between this mail out and the previous one is that I've imported additional contact info for a lot of our contacts, and although the emails have been matched, so the contact records have been filled rather than duplicated, the newly imported emails have all been added as 'Home' - and the original email was 'Main', or 'Work', or 'Billing'... </p>
  
  <p>Which is fine, if messy - lots of duplicated emails in records, but all the info is in the correct contact record. The problem - as far as I can work out - is that none of the emails have been marked as the one to be used for bulk mailings, and rather than default to the primary email for those contacts, CiviMail simply skips those contacts completely. </p>
  
  <p>So, assuming I haven't missed something, it seems like the only option I have is to edit the database with something along the lines of 'if email is primary, set is bulkmail to yes' - given that my confidence in editing via sql is more or less nil, I'd be grateful for any pointers in carrying this out. </p>
  
  <p>ETA: I’ve noticed that a couple of contacts which do have the bulk mail selected (both with two different emails to send the mail out to, rather than duplicate emails) also did not get sent the mail out, so it looks like setting the bulk mail email isn’t going to fix this...</p>
  
  <p>(It also appears to happen with a smaller mailing list - nearly 100 contacts in the group, none on hold, but only 49 recipients indicated when you add that group to a new mail out)</p>
  
  <p>ETA #2: Finally managed to pin this down to missing values in the is_deceased field - all the contacts with newly imported data seem to have lost the value for this field, even though I'd set the import mapping to skip that field entirely (as I'd already <del>eliminated</del> removed any deceased contacts from the import). Resetting the field to 0 fixed the problem - everyone is now back on the recipients list...</p>
  
  <p>I will add the fix as an answer :)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T07:26:58.097Z
Comments.Text: As you have also outlined It should not be necessary to mark one email-address as bulk - CiviCRM should default to the primary one. Could you make sure that at least one email-address is marked as primary? You could use the API explorer to do so.
Comments.UserDisplayName: Fabian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T15:53:42.677Z
Comments.Text: All the contacts have a Primary email.
Comments.UserDisplayName: liblogger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-31T15:58:10.370Z
Comments.Text: Aaand I’ve just noticed that a couple of contacts that do have the bulk mail email selected (for different email addresses) _also didn’t get sent this mail out, so it looks like there’s something else going on...
Comments.UserDisplayName: liblogger
Tags: <civimail><email><import>
Title: Contacts visible in mailing list group, not on hold or otherwise dnd, but skipped by mail out
ThreadText: # Contacts visible in mailing list group, not on hold or otherwise dnd, but skipped by mail out
  
  (Asked by: username_0 on 2018-08-30)
  
  I'm fairly sure I've worked out why this is happening, but want some input to confirm the problem, and hopefully pointers for fixing it.
  
  We totally refreshed our main mailing list in line with GDPR, so we've been mailing about 2000 people with only a handful of bounces and unsubscriptions; now suddenly with our latest mail out, CiviCRM is only finding half of these people. Looking at the group, they're still there, and only a dozen of these are on hold due to bounces. Anyone who unsubscribed isn't counted towards the group total, so that's not the issue. Checking for duplication, it's not that we accidentally created 1000 duplicate contacts, so that's not the issue.
  
  What has happened between this mail out and the previous one is that I've imported additional contact info for a lot of our contacts, and although the emails have been matched, so the contact records have been filled rather than duplicated, the newly imported emails have all been added as 'Home' - and the original email was 'Main', or 'Work', or 'Billing'...
  
  Which is fine, if messy - lots of duplicated emails in records, but all the info is in the correct contact record. The problem - as far as I can work out - is that none of the emails have been marked as the one to be used for bulk mailings, and rather than default to the primary email for those contacts, CiviMail simply skips those contacts completely.
  
  So, assuming I haven't missed something, it seems like the only option I have is to edit the database with something along the lines of 'if email is primary, set is bulkmail to yes' - given that my confidence in editing via sql is more or less nil, I'd be grateful for any pointers in carrying this out.
  
  ETA: I’ve noticed that a couple of contacts which do have the bulk mail selected (both with two different emails to send the mail out to, rather than duplicate emails) also did not get sent the mail out, so it looks like setting the bulk mail email isn’t going to fix this...
  
  (It also appears to happen with a smaller mailing list - nearly 100 contacts in the group, none on hold, but only 49 recipients indicated when you add that group to a new mail out)
  
  ETA #2: Finally managed to pin this down to missing values in the is\_deceased field - all the contacts with newly imported data seem to have lost the value for this field, even though I'd set the import mapping to skip that field entirely (as I'd already ~~eliminated~~ removed any deceased contacts from the import). Resetting the field to 0 fixed the problem - everyone is now back on the recipients list...
  
  I will add the fix as an answer :)
  
  **Tags:** civimail, email, import
  
  > **Comments:**
  > **username_1**: As you have also outlined It should not be necessary to mark one email-address as bulk - CiviCRM should default to the primary one. Could you make sure that at least one email-address is marked as primary? You could use the API explorer to do so.  
  > **username_0**: All the contacts have a Primary email.  
  > **username_0**: Aaand I’ve just noticed that a couple of contacts that do have the bulk mail email selected (for different email addresses) _also didn’t get sent this mail out, so it looks like there’s something else going on...  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-09-04. Score: 2 | Accepted answer
  
  As I've added to my question, it turns out the problem wasn't with the emails or the DND settings - the missing contacts all had a NULL value for is\_deceased, and apparently CiviCRM interprets this as them being dead (rather than just missing information). When you edit the entire contact record, this is flagged, but because I was just checking the emails and DND settings in place, I hadn't noticed this.
  
  Setting all the null values to 0 fixed the problem - I ran the following SQL query on the civicrm\_contact table:
  
  UPDATE civicrm\_contact SET is\_deceased = 0 WHERE is\_deceased IS NULL;
  
  (As per the answer here: <https://civicrm.stackexchange.com/a/7396/610> )
  
  Following that, all the relevant contact records reappeared in the mailing list recipient count.
  
  (Double checking the import field mapping, it turns out I didn't tell it to skip that field - CiviCRM exports the field as empty if is\_deceased = 0, so I guess importing it did overwrite the existing values)
  
  
  ---
  
  ### Answer by username_1 on 2018-09-03. Score: 0
  
  You have probably checked that already but you have to make sure that the contacts do not have a global opt out which is different from the subscription status of the group.
  
  Have a look at the opt out flag:
  [![Opt Out Setting](https://i.sstatic.net/svo89.png)](https://i.sstatic.net/svo89.png)
  
  > **Comments:**
  > **username_0**: No, they definitely aren't opted-out.  
  
  ---
  
  