Answers.Body: <p>Receiving mail servers use a variety of different metrics to give your mail a 'spaminess' score to decide whether it is spam or not.</p>
  
  <blockquote>
    <p>Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?</p>
  </blockquote>
  
  <p>There are small differences in the email headers generated via different routes. These <em>may</em> be affecting the score. The differing content is likely having an effect as well (even simple messages can appear spammy to receiving mail servers).</p>
  
  <p>My hunch is that you don't have DKIM set up. Setting up DKIM will reduce your score and put you under the threshold in both cases, though it wouldn't work if:</p>
  
  <ul>
  <li>your emails (headers and content) look really spammy to the receiving mail server's algorithms </li>
  <li>clients using the receiving mail server keep on marking your emails as spam</li>
  </ul>
  
  <p>Typically a receiving mail server will add a header to the email with 'authentication results' that typically refer to DKIM, SPF and DMARC. For example, when google receives a mail, it adds a "ARC-Authentication-Results:" header.</p>
  
  <p>Posting those headers would be useful so we can check what it says about DKIM and SPF:</p>
  
  <ul>
  <li><p>If you are sending via mail() is it likely not using DKIM. The easiest way of adding DKIM is to switch to a third party mail provider.</p></li>
  <li><p>Also, you may have (in the eyes of the receiving mail server) a mis-configured SPF record, so worth checking.</p></li>
  </ul>
  
  <p>A couple of final things to note:</p>
  
  <ul>
  <li><p>Each receiving mail server / service has its own algorithms. What works for one, might not for another.</p></li>
  <li><p>You need to give the receving mail server time to get used to this new source of mail (regardless of whether the config is correct or not). If the total  volume of mail is low, receiving mail servers may never get used to it. This is one reason why many people choose to use a third party service. </p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T08:19:03.633Z
Answers.LastActivityDate: 2019-08-07T05:20:22.913Z
Answers.LastEditDate: 2019-08-07T05:20:22.913Z
Answers.UserDisplayName: michaelmcandrew
Body: <p>We have an install where on certain contacts if you send an email directly from the contact record it goes through correctly. If an email is triggered via CiviRules it goes to SPAM. The email content is the same as well as the from address. This also happens when emails are sent from CiviMail (traditional). We are using mail() for outbound mail.</p>
  
  <p>Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?</p>
  
  <p>Install is in WordPress 5.2.2 with CiviCRM 5.13.4.</p>
  
  <p>The SPF record for the domain references the web server.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-02T23:17:48.080Z
Comments.Text: I suggest you try sending to a Gmail address. View the email on the Gmail web site, and from the 3 vertical dots icon at the top right select "Show original". At the top you'll see an indication of the validity of any SPF, DKIM and DMARQ records found. Comparing emails from the two sources should reveal the difference.
Comments.UserDisplayName: BobS
Tags: <civimail><email><civirules>
Title: Certain Emails, not all are falling into SPAM
ThreadText: # Certain Emails, not all are falling into SPAM
  
  (Asked by: username_0 on 2019-08-02)
  
  We have an install where on certain contacts if you send an email directly from the contact record it goes through correctly. If an email is triggered via CiviRules it goes to SPAM. The email content is the same as well as the from address. This also happens when emails are sent from CiviMail (traditional). We are using mail() for outbound mail.
  
  Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?
  
  Install is in WordPress 5.2.2 with CiviCRM 5.13.4.
  
  The SPF record for the domain references the web server.
  
  **Tags:** civimail, email, civirules
  
  > **Comments:**
  > **username_1**: I suggest you try sending to a Gmail address. View the email on the Gmail web site, and from the 3 vertical dots icon at the top right select "Show original". At the top you'll see an indication of the validity of any SPF, DKIM and DMARQ records found. Comparing emails from the two sources should reveal the difference.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-08-05. Score: 2
  
  Receiving mail servers use a variety of different metrics to give your mail a 'spaminess' score to decide whether it is spam or not.
  
  > Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?
  
  There are small differences in the email headers generated via different routes. These *may* be affecting the score. The differing content is likely having an effect as well (even simple messages can appear spammy to receiving mail servers).
  
  My hunch is that you don't have DKIM set up. Setting up DKIM will reduce your score and put you under the threshold in both cases, though it wouldn't work if:
  
  * your emails (headers and content) look really spammy to the receiving mail server's algorithms
  * clients using the receiving mail server keep on marking your emails as spam
  
  Typically a receiving mail server will add a header to the email with 'authentication results' that typically refer to DKIM, SPF and DMARC. For example, when google receives a mail, it adds a "ARC-Authentication-Results:" header.
  
  Posting those headers would be useful so we can check what it says about DKIM and SPF:
  
  * If you are sending via mail() is it likely not using DKIM. The easiest way of adding DKIM is to switch to a third party mail provider.
  * Also, you may have (in the eyes of the receiving mail server) a mis-configured SPF record, so worth checking.
  
  A couple of final things to note:
  
  * Each receiving mail server / service has its own algorithms. What works for one, might not for another.
  * You need to give the receving mail server time to get used to this new source of mail (regardless of whether the config is correct or not). If the total volume of mail is low, receiving mail servers may never get used to it. This is one reason why many people choose to use a third party service.
  
  
  ---
  
  