Hi All, I have a setup where I use postfix to connect to my work smtpd exchange server via TLS encryption and normal login authentication. This smtpd server also requires that the "From" address in the email header is from the same user that authenticates, otherwise I get a: "Client does not have permissions to send as this sender"
I can send emails via this system just fine using mutt or whatever command line mail I like, BUT I also use fetchmail to get email from our IMAP server. I then use a .forward file to keep a local copy AND send a copy to gmail as a backup. Unfortunately my work smptd exchange server rejects all of the forwards to gmail because it sees that the From address is NOT from the authenticated user (at least that is what I gather when I get these messages "Client does not have permissions to send as this sender" In essence: I would like to rewrite the "From" for ALL of the emails that leave my machine running postfix. They must have my authenticated email address (this is a single user machine). My hope is that this will tell the server that these are from me and not someone else. Now, I can use the smtp_generic_maps for a single address, but not ALL addresses. An example that I know works is: us...@hotmail.com us...@work.com Several people have suggested using the regexp with header_checks. Perhaps this would work, but thus far I've been spectacularly unsuccessful. I've tried these: main.cf: header_checks = regexp:/etc/postfix/header_checks header_checks: /From:.* <.@(.*)>/ REPLACE From: "user1" <us...@work.com> and I've also tried: /From:.*/ REPLACE From: "Michael J. Way" <michael.j....@nasa.gov> But none of these work. As a desperate measure I even tried: /From:*/ REPLACE From: "Michael J. Way" <michael.j....@nasa.gov> But this last one did not work AND several of the email headers had this From line 4 or 5 times. Is there any other simple way to get postfix to rewrite every outbound email From address to be the same us...@work.com ? I have searched in vain for several hours today to no avail. Thanks! mike