Hi! I have a special situation where Postfix doesn't replace the header-from correctly while using sender_canonical_maps.
There's a working sender_canonical_maps: root@mx01:~# postmap -q ckl...@example.com ldap:/etc/postfix/canonical-sender.ldap calvin.kl...@example.com root@mx01:~# And everything's set up in Postfix: sender_canonical_maps = proxy:ldap:/etc/postfix/canonical-sender.ldap local_header_rewrite_clients = permit sender_canonical_classes = envelope_sender, header_sender Postfix DOES replace the sender's address in Envelope and the Return-Path (!), but does NOT replace the sender's address in header-from. Return-Path: <calvin.kl...@example.com> From: Hallo Galli <ckl...@example.com> To: Herr Peer Heinlein <p.heinl...@heinlein-support.de> Subject: test2 Mails are delivered from Roundcube via smtpd to smtpd_proxy_filter, returning on port 10025 via smtpd. Just the normal standard setup for that. no_adress_rewriting in receive_override_options is NOT set! If I send this mail through sendmail/pickup to Postfix, everything's working fine and the sender's address is replaced completly. I don't understand that. I used "cleanup -vv" to generate the attached logfile. I can't see what's going wrong or where my misunderstanding is. Thanks to everybody who can help! Peer -- Heinlein Support GmbH Schwedter Str. 8/9b, 10119 Berlin http://www.heinlein-support.de Tel: 030 / 405051-42 Fax: 030 / 405051-19 Zwangsangaben lt. §35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Geschäftsführer: Peer Heinlein -- Sitz: Berlin
Mar 27 21:53:43 mx01 postfix/cleanup[7936]: connection establishedMar 27 21:53:43 mx01 postfix/cleanup[7936]: master_notify: status 0 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: mail_flow_get: 1 1 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: open incoming/DF23B461AA Mar 27 21:53:43 mx01 postfix/cleanup[7936]: cleanup_open: open incoming/DF23B461AA Mar 27 21:53:43 mx01 postfix/cleanup[7936]: dir_forest: DF23B461AA -> D/ Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr queue_id = DF23B461AA Mar 27 21:53:43 mx01 postfix/cleanup[7936]: cleanup socket: wanted attribute: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: 178 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: cleanup socket: wanted attribute: (list terminator) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping enable_smtp_reply Mar 27 21:53:43 mx01 postfix/cleanup[7936]: initial envelope T 1364417623 782962 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: initial envelope A rewrite_context=remote Mar 27 21:53:43 mx01 postfix/cleanup[7936]: initial envelope S ckl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: connect to subsystem private/rewrite Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr request = rewrite Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr rule = local Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr address = ckl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: 0 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: address Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: address Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: ckl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: (list terminator) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: rewrite_clnt: local: ckl...@example.com -> ckl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: connect to subsystem private/proxymap Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr request = lookup Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr table = ldap:/etc/postfix/canonical-sender.ldap Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr flags = 16448 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr key = ckl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: status Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: status Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: 0 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: value Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: value Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: (list terminator) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: dict_proxy_lookup: table=ldap:/etc/postfix/canonical-sender.ldap flags=lock|fold_fix key=ckl...@example.com -> status=0 result=calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: maps_find: sender_canonical_maps: proxy:ldap:/etc/postfix/canonical-sender.ldap(0,lock|fold_fix): ckl...@example.com = calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: mail_addr_find: ckl...@example.com -> calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr request = rewrite Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr rule = local Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr address = calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: flags Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: 0 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: address Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: address Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute value: calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: (list terminator) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:43 mx01 postfix/cleanup[7936]: rewrite_clnt: local: calvin.kl...@example.com -> calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: mail_addr_map: ckl...@example.com -> 0: calvin.kl...@example.com Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr request = lookup Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr table = ldap:/etc/postfix/canonical-sender.ldap Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr flags = 16448 Mar 27 21:53:43 mx01 postfix/cleanup[7936]: send attr key = calvin.kl...@example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: 1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: (list terminator) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: dict_proxy_lookup: table=ldap:/etc/postfix/canonical-sender.ldap flags=lock|fold_fix key=calvin.kl...@example.com -> status=1 result= Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: sender_canonical_maps: calvin.kl...@example.com: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: example.com ~? mx01.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: example.com ~? localhost.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: example.com ~? localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_list_match: example.com: no match Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr request = lookup Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr table = ldap:/etc/postfix/canonical-sender.ldap Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr flags = 16448 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr key = @example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: 1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: (list terminator) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: dict_proxy_lookup: table=ldap:/etc/postfix/canonical-sender.ldap flags=lock|fold_fix key=@example.com -> status=1 result= Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: sender_canonical_maps: @example.com: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_find: calvin.kl...@example.com -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_map: calvin.kl...@example.com -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A encoding=7bit Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_client_name=www2.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_client_address=xxx.yy.226.11 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_client_port=54819 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_message_origin=www2.example.com[xxx.yy.226.11] Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_helo_name=webmail.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A log_protocol_name=ESMTP Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A client_name=localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A reverse_client_name=localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A client_address=127.0.0.1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A client_port=33502 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A helo_name=localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A protocol_name=ESMTP Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A client_address_type=2 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope A dsn_orig_rcpt=rfc822;p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope R p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr request = rewrite Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr rule = local Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr address = p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: flags Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: flags Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: 0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: address Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: address Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/rewrite socket: wanted attribute: (list terminator) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: rewrite_clnt: local: p.heinl...@heinlein-support.de -> p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: recipient_canonical_maps: p.heinl...@heinlein-support.de: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? mx01.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? localhost.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_list_match: heinlein-support.de: no match Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: recipient_canonical_maps: @heinlein-support.de: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_find: p.heinl...@heinlein-support.de -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_map: p.heinl...@heinlein-support.de -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: been_here_check: p.heinl...@heinlein-support.de: 0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr request = lookup Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr table = ldap:/etc/postfix/virtual-mail2username.ldap Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr flags = 16448 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr key = p.heinl...@heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: 1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: (list terminator) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: dict_proxy_lookup: table=ldap:/etc/postfix/virtual-mail2username.ldap flags=lock|fold_fix key=p.heinl...@heinlein-support.de -> status=1 result= Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: virtual_alias_maps: p.heinl...@heinlein-support.de: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? mx01.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? localhost.example.com Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_string: heinlein-support.de ~? localhost Mar 27 21:53:44 mx01 postfix/cleanup[7936]: match_list_match: heinlein-support.de: no match Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr request = lookup Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr table = ldap:/etc/postfix/virtual-mail2username.ldap Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr flags = 16448 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr key = @heinlein-support.de Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: status Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: 1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: value Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute value: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: private/proxymap socket: wanted attribute: (list terminator) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: input attribute name: (end) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: dict_proxy_lookup: table=ldap:/etc/postfix/virtual-mail2username.ldap flags=lock|fold_fix key=@heinlein-support.de -> status=1 result= Mar 27 21:53:44 mx01 postfix/cleanup[7936]: maps_find: virtual_alias_maps: @heinlein-support.de: not found Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_find: p.heinl...@heinlein-support.de -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: mail_addr_map: p.heinl...@heinlein-support.de -> (not found) Mar 27 21:53:44 mx01 postfix/cleanup[7936]: been_here: rfc822;p.heinl...@heinlein-support.de?0?p.heinl...@heinlein-support.de?p.heinl...@heinlein-support.de: 0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: initial envelope M Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Received: from localhost (localhost [127.0.0.1])??by mx01.example.com (Postfix) with ESMTP id DF23B461AA??for <p.heinl...@heinlein-support.de>; Wed, 27 Mar 2013 21:53:43 +0100 (CET)' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'X-Virus-Scanned: Debian amavisd-new at mx01.example.com' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Received: from mailstore1.example.com ([xxx.yy.12.230])??by localhost (mx01.example.com [xxx.yy.226.42]) (amavisd-new, port 10034)??with ESMTP id AmpDCYATxXOr for <p.heinlein@heinlein-' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Received: from webmail.example.com (www2.example.com [xxx.yy.226.11])??(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))??(No client certificate requested)??by mailstore1.beu' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Received: from dslb-088-073-129-110.pools.arcor-ip.net ([xx.yy.129.110])? by webmail.example.com? with HTTP (HTTP/1.1 POST); Wed, 27 Mar 2013 21:53:42 +0100' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'MIME-Version: 1.0' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Date: Wed, 27 Mar 2013 21:53:42 +0100' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'From: Cali Calli <ckl...@example.com>' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'To: <p.heinl...@heinlein-support.de>' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Subject: test test test' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'Message-ID: <97052ef8509fcd9bd4179a480fdd7...@example.com>' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: DF23B461AA: message-id=<97052ef8509fcd9bd4179a480fdd7...@example.com> Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'X-Sender: ckl...@example.com' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_header_callback: 'User-Agent: Roundcube Webmail/0.8.5' Mar 27 21:53:44 mx01 postfix/cleanup[7936]: extracted envelope E Mar 27 21:53:44 mx01 postfix/cleanup[7936]: cleanup_flush: status 0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr status = 0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: send attr reason = Mar 27 21:53:44 mx01 postfix/cleanup[7936]: master_notify: status 1 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: connection closed Mar 27 21:53:44 mx01 postfix/cleanup[7936]: watchdog_stop: 0x7ff9db410bf0 Mar 27 21:53:44 mx01 postfix/cleanup[7936]: watchdog_start: 0x7ff9db410bf0