I have 1 domain and 2 aws ec2 instances. I have 2 subdomains, 'dev.mydomain.tld` and 'prod.mydomain.tld' one pointing to one instance and the second pointing to the other one.
My primary domain is configured to point to the IP of one of this instances. I have configured MX, and txt/spf records and also rdns for all of them. Both machines have a local mta, POstfix for sending emails to customers. One of them, `dev` sends emails fine. The other one 'prod' will send email in 'spam' although it's configured to send emails using `dev`.
Oh, forgot to tell, when sending email from console (mail -s "test" email@example.com
< /dev/null ) I get the email fine, in INBOX. The trouble is when sending emails from Drupal. When drupal sends email, it gets into 'SPAM' dir.