I am running a Postfix with OpenDKIM for DKIM signing.
In the past, I have used a single domain and have not encountered issues with mail being labelled as spam.
I currently have multiple domains on the same machine, and spam issues have occurred.
My setup
In comparison to the single domain case, my current set-up is more involved:
in Postfix main.cf, I have the
myhostnamevariable set todomain1.com.I send an email with
sendmailadding aFrom:header to be who I want the mail to show as coming from, sayuser1@domain2.com. This mail is sent by the local useruser2.OpenDKIM receives my mail via a Postfix miller. It then changes all instances of the local user@hostname
user2@domain1.comto be the desired sender, in this caseuser1@domain2.com. This is achieved via the OpenDKIMReplaceRulesconfiguration variable.OpenDKIM signs the mail with the appropriate key.
the mail is handed back to Postfix for sending. Postfix then alters the sender domain to be
user1@domain2.com, via thesmtp_generic_mapsconfiguration variable.the email is received in my Gmail spam folder with the flag
it is similar to messages that were identified as spam in the past.
In addition to the above, I also created SPF and PTR reverse DNS records for the domains.
Spam Score
Testing my emails against https://testmailscore.com/report/smtp+u3vwb11jqrlyolutyz?reload=1, I receive confirmation that all the above steps are implemented correctly. My score returns: -1.7
The only negatives being:
a) Spamassassin Report: -0.7
Details: SPF_HELO_SOFTFAIL
SPF: HELO does not match SPF record (softfail)
Score: -0.9
b) Mail Authentication Report Details: [RDNS] [My.ip.address] is associated with [domain2.com]. RDNS mismatched Score: -0.5
c) Subject/Title Relevance Analysis Details: 0.3 for both Mail subject and HTML Title.
In Gmail, if I personally flag the email as not spam and move it to my inbox, then all subsequent emails are correctly received and not sent to spam.
However, sending to another Gmail account, the issue returns, and the mail is sent to spam again.
I have searched online but have not yet been able to find information that helps for the case where DKIM is correctly passing.
The error message returned by Gmail of it is similar to messages that were identified as spam in the past doesn't provide insight into what is causing the issue.
Could it be an internal Gmail blocklist?
If so, how do I get around this?
Has anyone encountered this challenge in the past who can offer some guidance?