We help IT Professionals succeed at work.

Postfix Routing for an Address Space

DrDamnit asked
We have a Postfix server that sends mail everywhere except one domain.

That one domain, we'll call it "problem.com" is protected by Postini spam filtering. We think that has something to do with it. So, we logged into the Postini account, and setup rules that should allow this email through. (The email is a form submission from problem.com's website).

The mail still doesn't come through.

So, I was wondering can I configure Postfix to send the email directly to the mail server instead of routing mail via MX records for this one domain? If we can deliver these forms from the website straight to their exchange box, the problem is solved.

Thanks in advance.


PS. Please provide examples of how to configure the Postfix box in your answer.
Watch Question


Firstly, even if there were an easy way of forcing Postfix to ignore an MX record, and just deliver all for a domain to a given host, the host has to be an SMTP server accepting mail.  So we're assuming that somehow problem.com not only provides mail exchanger servers to catch mail from the Internet, but has some other SMTP servers open to the Internet at large which independently and also accept mail.  I think this is a bit of a reach.

However, if you do KNOW of a server that:
a)  Is reachable on port 25 from your postfix server (verify by doing "telnet <remote ip> 25")
b)  Accepts mail for problem.com when sending a mail via telnet ("helo mydomain.com <enter>  mail from: user@mydomain.com <enter>  rcpt to:  recipient@problem.com <enter>  data <enter>  Body goes here <enter> .  <enter>)

...then I can give you a couple of ideas to maybe trick Postfix into using that remote server.  But it's pointless unless you've verified that both (a) and (b) above are true.
Top Expert 2011

If I'm understanding this correctly, you want to bypass Postini on the receiving end and delivery directly to the server that has the destination mailbox?  It's like a spammers dream come true!

Even if you did tell postfix to route mail destined for problem.com to a different server, that server would need to be configured to receive mail from your server for problem.com.  If problem.com has mail servers listening on internet:25 and accepts mail for problem.com from all sources, then there is a larger problem here.

If Postini is rejecting your mails, then there is most like a problem on the sending side that is causing it.
Linux Systems Admin
Use the transport file.

You will need something like this

Problem.com         smtp:[]

The square brackets tell it not to use MX

An alternative would be to edit /etc/postfix/transport to relay (only to problem.com) via your ISP:

problem.com   smtp:smtp.yourisp.com

Note: Whenever you edit the transport table, you also need to execute:
sudo postmap /etc/postfix/transport
sudo postfix reload

Note 2: for the transport file to have any effect, your main.cf file has to contain the following line:
transport_maps = hash:/etc/postfix/transport

The idea is that the remote SMTP server will accept sessions from your ISP, even though it is not blocking you. If this works, it would be a more stable solution, because the bypassing MX method would fail if the address of problem.com's server changed.

Also, do the postfix logs show the smtp sessions with problem.com failing with an error or concluding successfully? What error?

Have you done anything?
Most Valuable Expert 2012


We used the transport file. We configured the receiving server to accept mail from this server's public IP (in addition to Postini, it rejects everything else), and it works!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.