Forward one user with address rewriting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward one user with address rewriting

garyo
Hi folks.  I'm running postfix 2.5.1-2ubuntu1.2 on Ubuntu 8.04.  I think
I understand postfix admin pretty well, but I have one question I don't
know how to solve.

I have two machines running postfix and delivering mail locally.  Call
them m1.sub1.example.com and m2.sub2.example.com.  Most people get their
mail on m1.  I have one user, call him "user", who should instead have
his mail forwarded to m2 (including locally generated mail on that
machine e.g. from cron jobs); the catch is m2 only accepts mail
addressed to "example.com" and I can't change that.

I can set up this virtual mapping to make it forward the mail:
   [hidden email]  [hidden email]
but I need postfix to rewrite the recipient envelope addr to say
[hidden email], only in that case.  Otherwise m2 bounces the mail.

How can I do that without disturbing all the other users?

Thanks very much;

-- Gary
Reply | Threaded
Open this post in threaded view
|

Re: Forward one user with address rewriting

Wietse Venema
To redirect one without changing the recipient address:

/etc/postfix main.cf:
    transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
    [hidden email] smtp:mx.b.example.com

Many years ago I tried to unify virtual aliasing and transport
mapping into one table, but I gave up because it would be too hard
to use, and it would be too fragile for regular expressions.

        Wietse