postfix-users January 2011 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: filter emails not only by domain

Re: filter emails not only by domain

From: Victor Duchovni <Victor.Duchovni_at_nospam>
Date: Thu Jan 20 2011 - 16:47:16 GMT
To: postfix-users@postfix.org

On Thu, Jan 20, 2011 at 05:34:52PM +0100, Andrea Scarso wrote:

> Hi,
> i need to make a configuration to send mails as below:
>
> user@domain.com ----> IP1
> user.town1@domain.com ----> IP2
>
> So i added on transport_maps:
> domain.com smtp:[IP1]
>
> and on header_checks:
> /^to:.*\.town1@domain\.com/ FILTER smtp:[IP2]
>
> It's ugly, but it works...

It's not only ugly, but it does NOT work, since FILTER is a
message-level action, in this case misapplied to a message feature that
is recipient-specific. Multi-recipient mail will be mis-routed.

> Is there a way to make postfix send one mail to user1@domain.com via
> IP1, and one mail to user2.town1@domain.com via IP2?

Plenty of examples in the list archives, for example:

    http://archives.neohapsis.com/archives/postfix/2011-01/thread.html#198

-- Viktor.