Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm desperately trying to get Postfix to 'rewrite' the MAIL FROM envelope so that it's always in the form of: authenticated-user@$mydomain

I've been playing with the smtpd_sender_login_maps and smtpd_sender_restrictions options but these don't seem to provide anyway of forcing a certain value, merely accepting or rejecting the given value.

How can achieve this?

Thanks.

share|improve this question

2 Answers 2

No you can't.

Currently, postfix rewriting feature only doing some mapping like sender_canonical_maps. It will rewrite the sender like from accountA@example.com to accountB@example.com. Also, postfix won't pass the SASL information to rewriting engine.

You need milter or some kind of content_filter to do that.

I've been playing with the smtpd_sender_login_maps and smtpd_sender_restrictions options but these don't seem to provide anyway of forcing a certain value, merely accepting or rejecting the given value.

That's principle design of MTA, it has ACL-like functionality (to reject or permit email). And yes, postfix still has limited rewriting capability. See Address Rewriting README.

share|improve this answer

You probably want to use the generic maps feature. Take a look at:

http://www.postfix.org/SOHO_README.html

http://www.postfix.org/ADDRESS_REWRITING_README.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.