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

It's known that users can provide any email in From: field. I need to prevent it by rewriting it to email used in authorization procedure. Is it possible to do in postfix? Or may be other MTA?

share|improve this question

1 Answer 1

Yes smtpd_sender_restrictions to include reject_sender_login_mismatch or reject_authenticated_sender_login_mismatch along with any other restrictions you put in place (order does matter).

The table doesn't have to be hash and probably shouldn't be. If your setup is rather simple you will want PCRE or regex. More complicated setups use ldap, mysql,PostgreSQL or SQLite.

You can also mix and match, but do so with caution and proper testing postmap -q.

Depending how your clients are setup you may need to set smtpd_sasl_local_domain.

Additional examples: http://www.postfix.org/SASL_README.html#server_sasl_authz

share|improve this answer
    
Yes, it is better do REJECT a bad sender instead of rewriting it to a good one. –  mailq Aug 7 '12 at 20:00

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.