Я управляю почтовым сервером. Почтовый сервер работает с несколькими настроенными доменами. Проблема в том, что аутентифицированный пользователь может использовать любой идентификатор электронной почты отправителя, и мне нужно предотвратить это. Как я могу это сделать?
Пример: отправитель с электронной почтой anything@example.com
отправляет почту с адресом электронной почты отправителя как anything@yahoo.com
Мне нужно предотвратить это.
Вы делаете это с помощью параметра конфигурации smtpd_sender_login_maps
.
Это требует, чтобы пользователь прошел проверку подлинности SASL.
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.
Затем вы добавляете параметр конфигурации вместе с указанным выше в параметр smtpd_sender_restrictions, например;
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
Это работает с Postfix 2.1+. Если нет, reject_sender_login_mismatch
smtpd_sender_restrictions = reject_sender_login_mismatch
Согласно постфиксу документация
reject_authenticated_sender_login_mismatch заставляет reject_sender_login_mismatch
reject_sender_login_mismatch: Отклонить запрос, если $ smtpd_sender_login_maps указывает владельца для адреса MAIL FROM, но клиент (SASL) не вошел в систему как владелец адреса MAIL FROM; или когда клиент (SASL) вошел в систему, но имя входа клиента не владеет адресом MAIL FROM согласно $ smtpd_sender_login_maps.