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 filter e-mail to different IP addresses based on the recipients address. For example if there was a situation where one group of staff e.g. business critical users were hosted on a more expensive platform and and another group of staff e.g. normal users were stored on a cheaper platform.

The key would be that all still operated from the same domain name.

Is there a way of achieving this?

share|improve this question
There are many ways to do this. However you need to supply more details about your environment. In particular, are you on windows or linux? – Phil Hollenback Jan 18 '11 at 22:59
Our current client that is discussing this runs Windows - but ideally we would hope to have a solution that would work for Windows or Linux. – user35204 Jan 18 '11 at 23:05

Due to the lack of specifics in the question, this will be a generic overview of how this is done.

  1. Mail will be sent to the servers listed in the MX record of the domain.
  2. This server will be a Message Transfer Agent (MTA) that is a Smart Host.
  3. This MTA will then check the recipients against an internal list of where the recipients specific mailboxes reside.
  4. This MTA will then relay the incoming message to the internal MTAs where its list says to forward them.
  5. The second MTA will recieve the message from the first MTA and forward as needed. If the recipient is local to that MTA, it will forward it to the Mail Delivery Agent for storage in the actual mailbox.

To answer your question of, "Is it possible to filter e-mail to different IP addresses based on the recipients address." the answer is a qualified "yes". All mail will be delivered to the mail-servers listed in the MX record. Those servers then deliver the email based on routing policies.

For a specific example, if you have one group of users in Postfix on a VPS somewhere and another group of users in Google Apps, you will have to list your own MTA server (probably the Postfix server in this case) as the server in the MX record. Those servers will then provide the custom routing you're looking for.

The biggest hazard of this approach is that it makes spam-filtering harder. The most effective spam-filtering technique these days is IP reputation, and for that you need to be the first hop in the mail-chain. In this case it would be your MTA server, which means you need to put your best anti-spam software on that first server. Servers further down the relay chain have to rely on less robust lexical scanning.

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.