On Fri, Nov 12, 2010 at 12:07:21PM +0100, Jeroen Geilman wrote:
>>> Reading the regexp man page suggests that the following would work in
>>> sender_canonical_maps:
>>>
>>> /\"From:(.*)\"@(.*)/ REPLACE $...@${2}
>>>
>>> However, this does not seem to get matched in any way.
>>>
>>> Anyone have any ideas?
With Postfix 2.7.0 or later, this is best fixed via:
main.cf:
pcre = pcre:${config_directory}/
smtpd_command_filter = ${pcre}smtpd_cmd.pcre
smtpd_cmd.pcre:
# Blissful memories of Sendmail:
/^(MAIL FROM:)<From:(\S+)@(.*?)>( .*)?/ $1<$...@$3>$4
At this stage the envelope sender is unlikely to be "quoted", that
happens once the malformed address is further processed by Postfix,
but we are capturing it upstream...
Test the pcre table with:
postmap -fq "MAIL FROM:<...> SIZE=12345" pcre:/etc/postfix/smtpd_cmd.pcre
before deploying into main.cf. If don't have PCRE, use a regexp table
and suitably modified syntax.
--
Viktor.