Right now I am sending emails using the php mail() function. I am setting the
From: header to an address corresponding to the hostname and also reverse-dns of the server sending the email like this:
$header = 'From: Foo <email@example.com>' . "\r\n" . 'Reply-To: firstname.lastname@example.org' ; $x = mail($to,$subject,$body,$header);
This works fine so var, every email gets through with all providers I tested.
The hostname is just something long and generic from my isp that supplies the root server.
I know that I can have the From: -header corresponding to my domain if I change the hostname (either system or in sendmail) and set up reverse dns accordintly.
However hostname to the same domain as a website runs on can cause problems in apache (like delivering the default vhost and not the domain specific).
I know that this all can be handled, however I would like not to have to manage mailserver and so on and thoughta bout using Amazon Simple Email Service
I set it up and everything, but emails keep getting marked as spam by Gmail.
I was surprised, because the reverse dns and spf policies correspond to the envelope adresses. However gmail seems to particuarly strict when evaulating the From: -header.
So I added SPF and SenderID records to my DNS
(I read up on that and added them using a wizard tool, from my understanding they should be correct. maby i have an error in here?)
And this is the output of
dig -t txt mydomain.com
;; ANSWER SECTION: mydomain.com. 1800 IN TXT "spf2.0/pra include:amazonses.com include:_spf.google.com ip4:22.214.171.124 ?all" mydomain.com. 1800 IN TXT "v=spf1 include:amazonses.com include:_spf.google.com ip4:126.96.36.199 ?all"
I already allowed several dails for changes to propagate, but gmail still keeps marking my emails as spam.
So lets sum it up:
The From: -header tld does not correspond with the envelope domain, but the envelope domain does correspond with reverse dns and hostname of sending server (this is all amazon).
There are SPF and SenderId records set up that correspond to the From: -header.
Gmail keeps marking mail as spam.
Can anyone point me in the right direction?