I have configured the check_recipient_mx_access option in Postfix in order to reject emails to misspelled domains.
We have a system that sends air flight confirmations and many times users write the contact email account incorrectly.
The documentation indicates the following
check_recipient_mx_access type:table
Search the specified access(5) database for the MX hosts for the
RCPT TO domain, and execute the corresponding action. If no MX
record is found, look up A or AAAA records, just like the Postfix
SMTP client would. Note: a result of "OK" is not allowed for safety
reasons. Instead, use DUNNO in order to exclude specific hosts from
denylists. This feature is available in Postfix 2.1 and later.
My configuration is as follows:
main.cf
smtpd_recipient_restrictions = reject_invalid_hostname,
reject_unauth_pipelining,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
check_client_access hash:/etc/postfix/rbl_override,
check_recipient_mx_access hash:/etc/postfix/bogus_mx,
The following rule is added to the file bogus_mx:
54.159.98.68 REJECT
when I try to send an email via telnet the same is not rejected:
root@mailserver:~# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail-front.kiusys.com ESMTP Postfix (Debian/GNU)
ehlo me
250-mail-front.kiusys.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Test Telnet
Hello dear,
.
250 2.0.0 Ok: queued as D161160E5D
quit
221 2.0.0 Bye
Connection closed by foreign host.
System information:
root@mailserver:/etc/postfix# postconf mail_version
mail_version = 2.11.3
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.11 (jessie)
Release: 8.11
Codename: jessie
Any ideas??
Regards,