Hi,
I am currently working on a project to reroute email to a server based
on the user part of the recipient address.
Like so:
[EMAIL PROTECTED] -> [EMAIL PROTECTED]
[EMAIL PROTECTED] -> [EMAIL PROTECTED]
<everything else>@mydomain.com -> <everything else>@mydomain.com
(stays unaltered)
However, if the user part starts with 'a', a body_check should be
invoked prepending one line in the message body with a keyword.
Here's what I have done so far:
I have setup postfix using virtual with a regexp table to do the
rewriting and I have made a regexp table body_checks to do the
prepending. Both work.
Then I instruct postfix via master.cf to ignore the body_checks for the
outside ip with:
my.ip.addr.ess:smtp inet n - n - -
smtpd
-o receive_override_options=no_header_body_checks
And postfix on the localhost address to use an alternative transport map
127.0.0.1:smtp inet n - n - - smtpd
-o transport_maps=hash:/etc/postfix/transport.alt
In main.cf I have defined transport_map=regexp:/etc/postfix/transport
like so:
/^a.*/ smtp:localhost
And /etc/postfix/transport.alt :
mydomain.com smtp:smtp.mydomain.com #(this one
should be necessary)
myotherdomain.com smtp:smtp.myotherdomain.com
If I test with an email address not starting with 'a' the localhost
prepends and delivers and the public route doesn't prepend but still
delivers.
But if I test with addresses starting with 'a' it seems however that
postfix is only looking at the primary transport_map thus causing 'mail
loops back to myself' errors.
Maybe I'm overlooking something obvious, or maybe I'm just trying to do
something that postfix just won't do, maybe there is another way to do
this.
I'm hoping someone can point me in the right direction.
Thanks,
Niels Mineur
The information contained in this email is strictly confidential and subject to
the Confidentiality Notice at http://www.stratosglobal.com/email-privacy.html