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

is it possible to configure Postfix to verify the sender's MX record?

For example: if a mail comes in from it should look up the MX record(s) for and verify that the sending mail server is listed in the MX records.

Is this possible and does it make sense to block spam mails? Or is there another way to stop spam mails pretending to come from trustworthy domains?


share|improve this question
up vote 9 down vote accepted

A word of warning:

An MX record provides information about where email should be delivered. It does not necessarily provide any information about where email originates. It is entirely possible -- even likely -- that mail will be coming from a system that is not listed as an MX for the given domain.

SPF records, on the other hand, allow you to verify that email is being sent by a system that is an authoritative sender for the domain.

share|improve this answer
Thanks for the nice explanation. – Baldewin Jun 24 '11 at 20:06

You could configure your spam filtering software to verify SPF records -- This does what you're asking, but in a slightly more intelligent way.

Denying mail because the sending server is not listed in the SPF record for a domain doesn't really make sense though -- Many residential ISPs block access to all but their mail server, which means that you may receive mail from domains you correspond with that came from one of those ISPs, and was forced through the ISP's mail infrastructure.

If you're looking for ways to fight spam, consider SpamAssassin and ClamAV, as well as any number of other options like Google's Postini service ($). Dealing with Spam is a specialist subset of system administration, and if you search around on SF or Google you'll find lots of different options that can help you out...

share|improve this answer
I have SpamAssassin running but I thought blocking mails with suspicious senders at all could be even more safe :) Thanks for your help! – Baldewin Jun 24 '11 at 20:08

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.