I own two domains, let's call them example.com and mydomain.net. These two domains point to the same ip address, let's say x.x.x.x, and both their A and MX records point to them. They also have SPF records (identical, since I only allow x.x.x.x to send mail on their behalf), but not DKIM. The two domains are on two different registrars. This is what happens: if I send mail from example.com, all goes well, mail doesn't get marked as spam, and always reaches its destination. If I send mail from mydomain.net instead, some servers refuse it (550 invalid domain error), many servers delay it, many others mark it as spam. So basically, if I get into the console (on the very same machine, x.x.x.x) and type

mail -aFrom:test@example.com -s "test" "johndoe@somedomain.com"

the message reaches its target. Then I type

mail -aFrom:test@mydomain.net -s "test" "johndoe@somedomain.com"

and I get a 550 Invalid domain error. Doing the same thing with other destination addresses always results in the first command reaching destination without problems, the second having delays or being marked as spam. The reverse ip points to yet another domain name so it can't be that. The ip and the domains are not in blacklists (though the IP has been in the past). What are the possible causes of such a situation?

  • 1
    If the email is marked as spam - check it's source, there could be a hint why it was marked. – DukeLion Nov 7 '15 at 12:00
  • There's no clue; both mails appear the same. Same headers, everything – didrocks66 Nov 7 '15 at 14:03

Does your ehlo, match your ptr, match your a record ?

It sounds like your ehlo matches one domain but not the other, so it looks like an impersonation issue, usually SPF helps with that but without full details is hard to give you an exact fix.

Typically... (abbreviated)

example.net in a

mx.example.net in a

example.net in mx 10 mx in ptr mx

example.net in txt "v=spf1 ip4: -all"

example.com in mx 10 mx.example.net

example.com in txt "v=spf1 include:example.net -all"

  • Thanks. It was almost like that. Including the ptr in the spf solved the problem, nothing more marked as spam and no invalid domain errors. – didrocks66 Nov 8 '15 at 22:33
  • ptr mechanism? You should just add the ip4:x.x.x.x instead – Jacob Evans Nov 8 '15 at 22:36
  • The original spf was "v=spf1 ip4:x.x.x.x -all", and my mails went into spam or got the 550 invalid domain error. I changed it to "v=spf1 ip4:x.x.x.x include:ptr -all" where ptr is the reverse lookup of x.x.x.x and problems are gone. – didrocks66 Nov 9 '15 at 11:13
  • That disabled the spf – Jacob Evans Nov 9 '15 at 13:00
  • Include, does a txt lookup for another spf domain name, ptr:example.com permits any reverse dns that resolves to example.com – Jacob Evans Nov 9 '15 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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