1

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

4 Answers 4

1

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.

tcpdump -s 0 -w - port 25 | strings
1

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

1
  • SPF does nothing at all to prevent email sent by you being marked as spam. That's not what it was designed for. It is useful for mail providers to be able to verify that email claiming to be from you is actually from you. No one else will be able to send email using an email address @domain.se to a provider that uses SPF.
    – Ladadadada
    Nov 2, 2010 at 14:00
0

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.

4
  • I have the settings you can see above... Thats it. Sep 25, 2010 at 20:24
  • I see a txt and a couple of A records, just no PTR record. If you do a host command on your IP, does it return your domain?
    – MaQleod
    Sep 25, 2010 at 20:58
  • Sorry for the late response. When I do a host on the IP, I get the email-servers name as a response (server1.domain.se) Sep 26, 2010 at 14:41
  • Since RDNS is setup, you now need to check central blacklists, which most major ISPs will reference, you can check common blacklists using this tool: mxtoolbox.com/blacklists.aspx. It would also help to know exactly what the bounce error message is saying (error codes and all).
    – MaQleod
    Sep 27, 2010 at 19:00
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .