I have tried understanding SPF but the terms used are beyond my experience, so I turn to you guys now.
I have a Virtual private server (VPS) which I manage myself.
I have installed postfix on it, and have a server named:
server1.domain.se
Now, the IP of my VPS is for example this:
111.111.11.1
Then I have my DOMAIN registered at an ISP, where I can manually setup my own DNS Records.
I have these records setup (IP REPLACED WITH "111.111.11.1"):
NAME TYPE DATA
www.domain.se A 111.111.11.1
domain.se A 111.111.11.1
server1.domain.se A 111.111.11.1
domain.se TXT v=spf1 a mx ptr ~all
When I send email using php:s mail function the emails are considered spam by gmail, hotmail, and all other email-servers. Why is this?
Here is how I send the mail in php:
$mail_message= "THE MESSAGE GOES HERE";
$headers="MIME-Version: 1.0"."\n";
$headers.="Content-type: text/plain; charset=UTF-8"."\n";
$headers.="From: Domain <[email protected]>"."\n";
$subject="Subject goes here";
mail($email, '=?UTF-8?B?'.base64_encode($subject).'?=', $mail_message, $headers, '[email protected]');
Above, the email adress [email protected] doesn't even exist, just so you know.
I am as I said before very new to email servers, so please explain in detail how to solve this...
If you need more input, like my postfix configuration or something, just let me know.
Thanks
defining spf is not the ultimate solution; use a rDNS, as somebody suggested earlier, lookup your ip in the RBL's on the internet - see www.anti-abuse.org for example consider installing domain keys for yahoo/gmail to accept your emails under (almost) any situations (bulk mail, etc)
and if you want a hands-on approach, post your postconf -n output
I'd try to learn why mail is getting blocked. Try setting up a test email account on Hotmail and send to that account. If it ends up in the spam folder, view the raw message with full headers. Often spam filters will append header information about the rules that caused the system to think it was spam.
Assuming you have root access to the machine, I'd run tcpdump to look at the transaction when you send your test message. Usually the MTA at the other end will provide you the reason for the block.
Have you set up RDNS with your ISP? A lack of a reverse pointer is the most common reason for mail to be considered spam by other servers.
Relay via your ISP's mail server. Configure your mail server to forward all outgoing messages to it until you have resolved your issues,
Until you get your PTR record pointing back to your domain you are likely to have problems. You will have to arrange this with your ISP. Do you have a static IP address, if not you shouldn't be trying to send directly to the Internet, and risk loosing incoming email.
Also check what your server thinks it name is this should be server1.domain.se. If it just says server1, or 111.111.11.1 you are not likely to be able to send email to many servers.
Read the bounce messages you get, as they may provide a clue as to why you were classified as spam. Also check your IP address at spamhaus.org. If you are blocked there, you will have problems with many servers. There are other sites that will check multiple blacklists for you.