0

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?

didrocks66
  • 21
  • 1
  • 4

1 Answers1

0

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 1.2.3.4

mx.example.net in a 1.2.3.5

example.net in mx 10 mx

5.3.2.1 in ptr mx

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

example.com in mx 10 mx.example.net

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

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
  • 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 08 '15 at 22:33
  • ptr mechanism? You should just add the ip4:x.x.x.x instead – Jacob Evans Nov 08 '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 09 '15 at 11:13
  • That disabled the spf – Jacob Evans Nov 09 '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 09 '15 at 13:08