Hello, not tested ... and as far as I remember ....
1/ use a mix of smtpd_client_restrictions" and "FILTER" to redirect trafic from 10.11.12.13 to a local smtpd/port (for smtpd/27) 10.11.12.13 FILTER smtp:[127.0.0.1]:27 2/ define a new local cleanup service on smtpd/27 something like that: 127.0.0.1:27 inet n - n - 2 smtpd ... -o cleanup_service_name=cleanup-rw ... 3/ finally define the new cleanup service with the rewriting information you need something like that: cleanup-rw unix n - n - 0 cleanup ... -o recipient_canonical_maps= regexp:/etc/postfix/recipientmap ... Note 1 : canonical = envelope and header Note 2: if you use for any reason (a content-filter for example) other cleanup service after the cleanup-rw do not forget to add a "-o recipient_canonical_maps=" on it to not make the check again Rgds Alain Le 05/12/13, Troels Hansen <t...@casalogic.dk> a écrit : > Hi, I have a problem with address rewriting. > The mail originates from a broken, cannot be changed, mail system that sends > out mails to the wrong receiver: > Ex: > Mail send to: firstname_lastn...@domain.dk > > Should have been send to: > firstname.lastn...@domain.com > > I have solved this with a canonical map this way: > > In main.cf: > > canonical_maps = regexp:/etc/postfix/recipientmap > > and recipientmap contains the following: > /^(.*)_(.*)@domain\.dk$/ ${1}.${2}@domain.com > > This works, however it should only be done from mails originating from the > broken system, ex 10.11.12.13 > I have struggled with this for some time, but cannot find a way to accomplish > this? > > > > >