Postfix advertises SMTPUTF8 but local LMTP delivery fails because dovecot does not support it
Summary
Postfix has SMTPUTF8 support enabled by default. External mailservers can take advantage of this to try to deliver UTF8 encoded messages. However when postfix attempts local delivery of such a message to Dovecot using LMTP it bounces because Dovecot does not have SMTPUTF8 support.
Steps to reproduce
- Send a message to a valid email address on ISPConfig with non-ASCII chars in the localpart - the easiest way is send to a catchall or to use a plus address e.g.:
user+tést@example.com
. Please note this is simply the easiest way to reproduce this error, but some mailservers may use SMTPUTF8 if there is any non-ASCII text in the entire message. - Check the logs or bounce DSN for the message:
SMTPUTF8 is required, but was not offered by host mail.example.com[private/dovecot-lmtp]
Correct behaviour
Postfix should not advertise SMTPUTF8 until Dovecot supports it.
$ telnet mail.example.com 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.example.com ESMTP Postfix
EHLO user.example.com
250-mail.example.com
250-PIPELINING
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8 <-- Disable this
250 CHUNKING
QUIT
221 2.0.0 Bye
Connection closed by foreign host.
Environment
- Server OS + version: CentOS 8.7
- ISPConfig version: 3.2.8
- Postfix version: 3.7.3
- Dovecot version: 2.3.16
Proposed fix
Disable SMTPUTF8 in postfix main.cf:
smtputf8_enable = no
References
Good starting place: https://unix.stackexchange.com/questions/320091/configure-postfix-and-dovecot-lmtp-to-receive-mail-via-smtputf8
Postfix documentation: https://www.postfix.org/SMTPUTF8_README.html
Log lines
dovecot[]: quota-status(): Error: Client sent invalid recipient address `user+tést@example.com': Invalid character in localpart
postfix/lmtp[]: to=<user+tést@example.com>, relay=mail.example.com[private/dovecot-lmtp], delay=0.03, delays=0.02/0/0/0, dsn=5.6.7, status=bounced (SMTPUTF8 is required, but was not offered by host mail.example.com[private/dovecot-lmtp])
Edited by Judah - MW