如何限制用户在Postfix中使用不同伪造的发件人电子邮件?

我正在pipe理邮件服务器。 邮件服务器正在运行,configuration了多个域。 问题是validation用户可以使用任何发件人的电子邮件ID,我需要防止它。 我怎样才能做到这一点?

例如:一个发件人与电子邮件[email protected]发送邮件与发件人的电子邮件地址为[email protected]

我需要阻止这一点。

这适用于Postfix 2.1+如果不是, reject_sender_login_mismatch

 smtpd_sender_restrictions = reject_sender_login_mismatch 

根据postfix 文档
reject_authenticated_sender_login_mismatch执行reject_sender_login_mismatch

reject_sender_login_mismatch:当$ smtpd_sender_login_maps指定MAIL FROM地址的所有者,但客户端不是(SASL)作为MAIL FROM地址所有者login时,拒绝该请求; 或当客户端(SASL)login时,但客户端login名不具有根据$ smtpd_sender_login_maps的MAIL FROM地址。

您可以使用configuration选项smtpd_sender_login_maps执行此smtpd_sender_login_maps

它要求用户有SASLauthentication。

smtpd_sender_login_maps(默认:空)

 Optional lookup table with the SASL login names that own sender (MAIL FROM) addresses. Specify zero or more "type:table" lookup tables. With lookups from indexed files such as DB or DBM, or from networked tables such as NIS, LDAP or SQL, the following search operations are done with a sender address of user@domain: 1) user@domain This table lookup is always done and has the highest precedence. 2) user This table lookup is done only when the domain part of the sender address matches $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. 3) @domain This table lookup is done last and has the lowest precedence. In all cases the result of table lookup must be either "not found" or a list of SASL login names separated by comma and/or whitespace. 

然后,您将一个configuration选项和上面一起添加到smtpd_sender_restrictions optoin中,例如;

 smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch