Possible to ensure that from address is not spoofed by mail server?

I want to know that is it possible that using postfix or any other MTA, i can apply a restriction that email sender cannot change/spoof his sender email, and email is only sent from the email ID, through which it was authenticated.

thanks


Solution 1:

I want to know that is it possible that using postfix or any other MTA, i can apply a restriction that email sender cannot change/spoof his sender email, and email is only sent from the email ID, through which it was authenticated.

yes, it possible. You can use smtpd_sender_login_maps with reject_authenticated_sender_login_mismatch

smtpd_sender_restrictions =
 permit_mynetworks,
 reject_authenticated_sender_login_mismatch,
 reject_unknown_sender_domain,
 reject_unlisted_sender,
 reject_unverified_sender

smtpd_sender_login_maps = hash:/etc/postfix/sender_logins_maps

/etc/postfix/sender_logins_maps
[email protected] sasl_login_name1

Solution 2:

In main.cf you'll want reject_authenticated_sender_login_mismatch as part of your smtpd_sender_restrictions. You'll then need to define smtpd_sender_login_maps. The use case you're describing can be done easily with with either a regex table or prce table.