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.

  • 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.
    – BobS
    Aug 2, 2019 at 23:17

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.