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?