On 10/23/2009 7:01 AM, Stevie Haston wrote:
Hi

Is it possible within postfix to use the virtual file or otherwise to
route mail into OS users mailbox based on sender domain.

Currently I've got in /etc/virtual

initial_recipient_1 localaccount, forward_recipient_1
initial_recipient_2 localaccount, forward_recipient_2

I'd like to say in rough pseudocode:

If sender_domain = x.com then
initial_recipient_1 localaccount_A, forward_recipient_1
initial_recipient_1 localaccount_A, forward_recipient_1
Fi

If sender_domain = y.com then
initial_recipient_1 localaccount_B, forward_recipient_1
initial_recipient_1 localaccount_B, forward_recipient_1
Fi

Any ideas much appreciated.


Postfix doesn't have anything quite like that built in. Sender options include sender_dependent_relayhost_maps or using the REDIRECT action in a check_sender_access map, neither of which will do quite what you're asking for.

You could probably use procmail during delivery to forward the mail based on sender.

  -- Noel Jones

Reply via email to