On Wed, Jan 26, 2011 at 10:24:29AM +0100, Georg Sch?nweger wrote: > i have here postfix 2.6.5 on Ubuntu. Outgouing mails are sent via an > external SMTP Server (relayhost..). When i send an email from a local > user to a real email address i have in the email header "Return-Path: > root@SERVER_NAME". So i can't get back any bouncing or error mails.. I > use the server mainly for websites so when i send mails via the > webserver then i have the same problem, the envelope sender is > "www-data@SERVER_NAME" (i know i could change this via PHP-Mail command > but i'm using a CMS and i won't change that..) So i tried to masquerade > ONLY the envelope sender address. For this i use Canonical address mapping. > /etc/postfix/main.cf: > sender_canonical_classes = envelope_sender > sender_canonical_maps = hash:/etc/postfix/sender_canonical
Don't use sender_canonical_maps, it is essentially an obsolete feature, its semantics are flawed. Use smtp_generic_maps, selectively per-transport (master.cf -o smtp_generic_maps=$transportname_generic_maps overrides) if you need different results depending on destination. -- Viktor.