Hi,

I'm having a problem with Postfix 2.6.6 on CentOS 6.6.  I want to rewrite the 
sender for all mail sent by box to be "[email protected]".   I added to my 
main.cf a line "sender_canonical_maps = regexp:/etc/postfix/sender_canonical", 
and the contents of that file are:

                /.+/        [email protected]

But it only works when I send to a local address that gets forwarded to an 
external one via /etc/aliases.   Here's what I've found:

Mail to a local user
    Command: "echo Test | mail -s Test josby"
    Path in maillog:  cleanup->qmgr->local->qmgr->local->qmgr
    Result: envelope and header From are both [email protected]

Mail to a remote user
    Command: "echo Test | mail -s Test [email protected]"
    Path in maillog:   cleanup->qmgr->smtp->qmgr
    Result: envelope and header From are both [email protected]

Mail to a local user with forwarding defined in /etc/aliases  ("root: 
[email protected]")
    Command: echo "Test" | mail -s "Test" root
    Path in maillog:  cleanup->qmgr->local->qmgr->local->qmgr->smtp->qmgr
    Result: envelope and header From are both [email protected]


In the third test, the first appearance of string "[email protected]" in the 
maillog is from the qmgr that's in between local and smtp.   It looks to me 
like it's the fact that, for the mail forwarding via /etc/aliases, a second 
message with a new ID is actually created, and it's during that creation that 
the rewritten From address happens.    But why only then?  Why not for all 
messages created on the system?

Thanks in advance

Reply via email to