Dolibar emails marked as spam/phishing : setup DKIM, DMARC, SPF?

My MX entries are hosted at Google , Dolibarr uses STMP to send mails (invoices, etc…) and is on shared hosting (same server as website)

Yet, a number of invoices are consistently being marked as spam/junk for clients. When I send to myself to test, Google is showing the message can’t be authenticated.

I’ve added the DNS TXT DKIM (2048 bit key) from google, and on

I see both a valid SPF and DKIM entry …

However I’m still getting poorly delivered emails, (only when sent from dolibarr) and not sure how else to check/fix this issue …

Does Dolibarr suport 2048 bit keys? or should I use 1024?
I don’t see anything in the Email Module about authenticating (other than normal server/password authentication for the user mail server)

Invoices going to spam is bad . . . :-/

Hi Loji,

Your SPF record should contain the hostname and/or IP-adrress of the SMTP server from which your emails are send from.

Thanks TJ,

the SPF and DKIM seem to be set-up correctly on the same host as dolibarr, but Dolibarr still was being marked spam …

I changed dolibarr setting to mail through google-relay instead of localhost. Which mean I also had to change from the default dolibarr mailer deamon to Swift. (as the default would fail TLS, but Swift Mailer seemed to handle TLS fine).

So now, Dolibarr is sending mail through google-relay with DKIM and everything intact being delivered correctly. (Google doesn’t release their private key, so Swift is unable to sign DKIM itself and the relay is needed)

Good news, no more grey question icon with the message “does this email look safe” getting delivered to the junk folder. Messages from Dolibarr are authenticated and delivered correctly to inbox