2

I'm trying to set up my postfix server to alter the sender address of outgoing e-mails for one specific recipient domain (example.com) -- otherwise I'd just configure smtp_generic_maps in main.cf and be done with it.

From what I understand, for this sort of configuration, there is a need to set up an extra transport that handles the traffic I want to get mangled.

So far I've set up an extra smtp transport:

transport:

example.com    drewrite:

master.cf:

smtp         unix  -       -       -       -       -       smtp
drewrite     unix  -       -       -       -       -       smtp 
    -o smtp_generic_maps=hash:/etc/postfix/rewrite_domain

rewrite_domain:

info@example.com     info@mydomain.com

The problem is that amavis is also configured to run on that server, and it seems to hinder the address rewriting in some way I honestly can't wrap my head around.

The curious thing is that when I bypass the transport and set the smtp_generic_maps in main.cf to overwrite the sender address for all recipients; the address gets rewritten OK.

This led me to believe that perhaps the transport is not set up correctly; but postfix logs show that it is in fact being used (and when I did manage to bork it earlier I got deferred messages in the queue).

The only way I've been able to get this working was to disable amavis globally.

lubomir.brindza
  • 256
  • 3
  • 10
  • I can't see your error messages and therefor can't see the problem. Have you read this http://www.postfix.org/ADDRESS_REWRITING_README.html ?? – mailq Jun 30 '12 at 19:40
  • Yes, I did read the whole thing. There are no error messages, the whole `smtp_generic_maps` clause is just silently ignored, probably because the mail gets processed by amavis sooner than rewriting is done. I did enable verbose logging for this, but didn't see anything out of the ordinary. Still, disabling amavis solves this problem (and causes a bunch of others, I'm sure), so I'm fairly sure that rewriting is set up correctly. I still didn't consult amavis mailing list, to that might turn something up. – lubomir.brindza Jul 01 '12 at 08:45
  • 1
    Try disabling avamis only for drewrite – sanmai Oct 09 '14 at 06:12

0 Answers0