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

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 google.com domain. From now on he is able to send e-mails from google.com 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

3 Answers 3

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

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 google.com as a domain in Postfix how would Postfix know that the client doesn't actually own google.com? 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 google.com to user on the same sarver that have gmail.com 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 gmail.com). –  sq4ind Jun 2 '11 at 12:38

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

in /etc/postfix/transport

google.com smtp:yourmx.com

Where yourmx.com 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 * smtp:yourmx.com. 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

 
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.