Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 there any way to configure Postfix in the way that it would check mx record before local delivery. For example - there is hosting platform, client added domain. From now on he is able to send e-mails from domain (but only in local delivery not to internet).

So is there any way to block this?? TO check MX record, if it is proper, before local delivery?

share|improve this question
You appear to be talking about restrictive controls on the envelope sender mailbox, not on the envelope recipient mailboxes, for locally-delivered mail. Is this correct? – JdeBP Jun 2 '11 at 14:13

I don't know anything about Postfix but I'm assuming it operates like any other MTA in that no MX lookup is performed for domains that Postfix is authoratative for.

How would Postfix know if the domain is "proper"? If a client adds as a domain in Postfix how would Postfix know that the client doesn't actually own That's something only human intelligence can determine.

share|improve this answer
Yeah I know that this can only be done bu human. But the problem is that if You are using domain and sending mail from this domain to smtp servers on internet they will be rejected. But if You are sending mails from this domain locally (from user that have domain to user on the same sarver that have domain) it will be delivered. But if You check mx record before local delivery this will not happened (the mail will not be delivered to – sq4ind Jun 2 '11 at 12:38

One possible way is to run a second instance of postfix on that server (or ideally use a second server as it's much simpler).

The "user" instance of postfix wouldn't have any local domains at all, only the "delivery" instance of postfix would have domains configured in it.

share|improve this answer

One way to do this that relies on an additional mailserver would be to configure postfix transport

in /etc/postfix/transport

Where is a SMTP server configured to relay mail for you.

I haven't tested this however.

share|improve this answer
I know that way - but it is not the way I want. I need to do this "on the fly" with every mail that is sent locally (there will be thousends of e-mail accounts). The way that You've presented is a way to type it manually;/ – sq4ind Jun 2 '11 at 12:50
I don't think what you want is possible... you could of course have * And I presume the setup of these systems would be scripted, so it wouldn't be "manual". – jamespo Jun 2 '11 at 13:43

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.