Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been reading a little about this and have found something called "sender policy framework" which looks like it will help with identifying mail correctly. Will this increase the chances of my sent mail not being marked as spam? Or will it simply increase the chances of spam sent with my domain in the headers being marked as spam?

Where can I find good practices on sending mail from a server?

One thing that is important is that I will be setting up google apps so that my client can use to get/send email. How can my server work correctly with these settings so that both mail sent from google apps and mail sent from the server (php code) are identified as authentic?

share|improve this question

Sender Policy Framework (SPF) is a scheme that lets domain owners/admins indicate which servers are permitted to send mail on behalf of their domain.

When used and trusted by receiving servers, it can filter out messages that do not originate from you, but claim to.

It is therefore not relevant for trying to ensure mail that is sent from you is accepted. That is a reputational issue. Make sure your mail server is not on a declared-home-broadband-IP, which might be listed in a policy block list such as . If you are trying to send mail from a residential IP, configure your MTA to route via a smarthost that isn't, such as your ISP.

read the listing policies for and make sure your mail server isn't violating any of those rules. Check your server to make sure it is minimally secure via a mail relay tester such as .

share|improve this answer

The grand answer is "It Depends". Correctly defined SPF records can help your mail be correctly categorized by many spam filters, but not all. Spammers usually setup SPF records, so spam filtering companies don't blindly trust anyone who sets them up. A good filter combines an SPF match, with a reputation system, so if you send clean mail, and you use SPF you are better off.

So it's a good idea to add it, but it isn't going to necessarily solve all of your problems.

share|improve this answer

SPF works by validating the host IP (or network) from which the message originated. It shouldn't matter how it was sent, as long as it is coming from a host that is validated by SPF.

SPF's job is to validate that a message is sent from correct hosts. So, if you have a lot of mail that is being spoofed with your domain and causing your domain to look spammy, SPF will help with that. But it doesn't help on per-message content that content filters think look spammy. That is, you can send a message from a valid host with words like "Viagra and Cialis" and still get it marked as spam.

share|improve this answer

Your Answer


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.