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
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:
smtpd_recipient_restrictions = reject_invalid_hostname,
The following rule is added to the file bogus_mx:
when I try to send an email via telnet the same is not rejected:
root@mailserver:~# telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 mail-front.kiusys.com ESMTP Postfix (Debian/GNU)
mail from: email@example.com
250 2.1.0 Ok
rcpt to: firstname.lastname@example.org
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
Subject: Test Telnet
250 2.0.0 Ok: queued as D161160E5D
221 2.0.0 Bye
Connection closed by foreign host.
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)