1

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?

Alexey
  • 11
  • 1

1 Answers1

3

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

84104
  • 12,905
  • 6
  • 45
  • 76