Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a linux server, with postfix just installed.

I am new to email-servers...

Anyways, I am able to send mail with php:s mail function, but they are considered "spam" by google mail (and probably most other email accounts also, haven't tested hotmail, yahoo etc).

I am guessing it has something to do with SPF, but I don't have a clue what SPF is, how to fix it etc etc...

Can anybody explain how to make my emails "Non-spam" which they are not?

OS is Ubuntu 9.10.

If you need more input let me know...

Thanks

PS: How can I disable all incoming mail to my postfix (email server) without using my firewall, maybe by using main.cf?

share|improve this question
1  
From Atwood blog: codinghorror.com/blog/2010/04/… –  Vitor Jul 5 '10 at 17:45
    
look at serverfault.com/questions/134518/… and serverfault.com/questions/128990/… - those are very similar questions –  pQd Jul 5 '10 at 18:42
    
This has been duplicated at serverfault.com/questions/157628/… which has more answers than this one. Don't know if there's a way of merging, but certainly one of these should be closed. –  kaerast Jul 5 '10 at 19:28
    
This is a duplicate of serverfault.com/questions/157649/… though this one has more answers than the original. –  kaerast Jul 5 '10 at 19:50

6 Answers 6

up vote 4 down vote accepted

Ok, there's 3 (very different things) you need to be doing to avoid false positives.

  1. Reverse DNS needs to be set-up, so the IP of your server resolves to your server's hostname. You need to ask your hosting provider/netblock owner to do this, you can't do it yourself directly.

  2. SPF. This involves adding an entry to the DNS zone record that your server is part of. It doesn't involve server configuration (unless it's also the nameserver for the domain). SPF generator may help here.

  3. Set-up DKIM on your server. Not too difficult, the dkim-filter package on Debain based systems IIRC, google for a tutorial.

You should also check that your domain and IP isn't on a block list somewhere. You need to google and read a lot as well - postmaster is no easy job.

Also have a look at MX Toolbox.

If you post your servers name, I can give further pointers.

share|improve this answer

I'm not a systems admin, so someone else can probably answer better :)

I know that some systems block mails without a reverse DNS entry for your MX record. Basically a method for looking up your servers ip address and match it the domain. Ask someone else about the details :-)

share|improve this answer

One common trick for eliminating having your mail marked as spam is to always send mail using valid From: headers.

For example if your hostname is 'bobs-server' and you send a mail using the local mail command (which is what PHP's mail() function does, by default), it will appear to come from something like "apache@bobs-server".

Of course, on the open Internet, bobs-server isn't a real domain and attempts to look up A or MX records for this host will fail. You should give your server (or at least the external IP/NAT it comes from) a valid A record (and/or MX record if you want to accept mail) and then use a from header to match, such as:

From: bob-mailer@alpha.bobs-servers.com

This will eliminate a lot of hosts regarding your mail as insta-spam. SPF records haven't really been implemented fully on the Internet and aren't commonly used authoritatively for whether or not something is spam.

Hope that helps.

share|improve this answer

SPF has nothing to do with identifying spam, it's about identifying forged email senders.

There are a long list of potential reasons from the server being on a blacklist (RBL) to issues with the mail formatting or headers. I'd suggest you start with checking that the IP isn't in any RBL.

share|improve this answer

I suspect your server is on a blacklist: http://www.dnsblcheck.co.uk/

share|improve this answer
    
+1, Also, could be a consumer connection, which is blacklisted by many servers (including all of ones I control). –  Chris S Jul 6 '10 at 2:29

For Batter Inbox delivery first of all configure and check you mail server configuration specially SPF and DKIM configuration. SPF Configuration: visit: openspf.net DKIM Configuration For Postfix in Ubuntu: https://help.ubuntu.com/community/Postfix/DKIM Testing of DKIM and SPF: http://www.port25.com/domainkeys/

After server configuration and testing please check you ip plack listing and sender score: Ip Blacklisting: mxtoolbox.com/blacklists.aspx Ip Reputation: senderscore.com (used by Yahoo and Aol), commtouch.com (Used by rediff)

After all this if you mail still found in spam then please check keywords of your email body. Check is your From address is valid.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.