Support for SMTPUTF8
Not really an issue wit SNM, more like an RFC or a knowledge base for anyone else interested.
So, the SMTPUTF8
extension allows UTF-8 in the “localpart” of addresses (i.e. 🐱@example.com
). This does not seem to be a particularly popular thing to do, but, on the other hand, it is supported in GMail and (apparently) Exchange, where people are starting to use their actual non-ASCII names in addresses. And, well, it’s 2021 anyway, one would think that these days software is aware of Unicode :/.
I tried using it with my SNM setup (to be precise, my “trying” comprised adding a UTF-8 alias for my address) and it did not work.
Full log
postfix/smtpd[9849]: connect from mail-yb1-xb2f.google.com[2607:f8b0:4864:20::b2f]
rspamd[9612]: <23a5f3>; proxy; proxy_accept_socket: accepted milter connection from /run/rspamd/rspamd-milter.sock port 0
postfix/smtpd[9849]: Anonymous TLS connection established from mail-yb1-xb2f.google.com[2607:f8b0:4864:20::b2f]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature ECDSA (P-256) server-digest SHA256
dovecot[9359]: quota-status: Error: Client sent invalid recipient address `📧@kir.elagin.me': Invalid character in localpart
policyd-spf[9856]: prepend Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b2f; helo=mail-yb1-xb2f.google.com; envelope-from=kirelagin@gmail.com; receiver=
postfix/smtpd[9849]: 633FA85126: client=mail-yb1-xb2f.google.com[2607:f8b0:4864:20::b2f]
rspamd[9612]: <23a5f3>; milter; rspamd_milter_process_command: got connection from [2607:f8b0:4864:20::b2f]:42967
postfix/cleanup[9857]: 633FA85126: message-id=
rspamd[9612]: <23a5f3>; proxy; rspamd_message_parse: loaded message; id: ; queue-id: <633FA85126>; size: 2464; checksum: <09525278dcad4b3b1014e40c9306e0ef>
rspamd[9612]: <23a5f3>; proxy; dkim_module_key_handler: stored DKIM key for 20161025._domainkey.gmail.com in LRU cache for 186 seconds, 1/2000 elements in the cache
rspamd[9612]: <23a5f3>; proxy; rspamd_spf_record_postprocess: increasing ttl from 130 to 300 as it lower than a limit
rspamd[9612]: <23a5f3>; proxy; rspamd_spf_maybe_return: stored record for gmail.com (0xc6f0caade56f8346) in LRU cache for 300 seconds, 1/2000 elements in the cache
rspamd[9612]: <23a5f3>; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_HAM of classifier bayes: not enough learns 1; 200 required
rspamd[9612]: <23a5f3>; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_SPAM of classifier bayes: not enough learns 4; 200 required
rspamd[9612]: <23a5f3>; proxy; rspamd_stat_classifiers_process: skip statistics as SPAM class is missing
rspamd[9612]: <23a5f3>; lua; greylist.lua:391: greylisting pass (body) until Sun, 04 Apr 2021 16:01:07 GMT
rspamd[9612]: <23a5f3>; lua; neural.lua:295: created new ANN profile for default:default, data stored at prefix rn_default_default_p6eua6dz_0
rspamd[9612]: <23a5f3>; proxy; rspamd_task_write_log: id: , qid: <633FA85126>, ip: 2607:f8b0:4864:20::b2f, from: , (default: T (add header): [10.00/15.00] [INVALID_RCPT_8BIT(6.00){},RCVD_ILLEGAL_CHARS(4.00){},TO_NEEDS_ENCODING(1.00){},DMARC_POLICY_ALLOW(-0.50){gmail.com;none;},R_DKIM_ALLOW(-0.20){gmail.com:s=20161025;},R_SPF_ALLOW(-0.20){+ip6:2607:f8b0:4000::/36;},MIME_GOOD(-0.10){text/plain;},ARC_NA(0.00){},ASN(0.00){asn:15169, ipnet:2607:f8b0::/32, country:US;},DKIM_TRACE(0.00){gmail.com:+;},FREEMAIL_ENVFROM(0.00){gmail.com;},FREEMAIL_FROM(0.00){gmail.com;},FROM_EQ_ENVFROM(0.00){},FROM_HAS_DN(0.00){},GREYLIST(0.00){pass;body;},MIME_TRACE(0.00){0:+;},PREVIOUSLY_DELIVERED(0.00){📧@kir.elagin.me;},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_TWO(0.00){2;},RCVD_TLS_ALL(0.00){},TO_DN_NONE(0.00){}]), len: 2464, time: 364.294ms, dns req: 19, digest: <09525278dcad4b3b1014e40c9306e0ef>, mime_rcpts: <📧@kir.elagin.me>
rspamd[9612]: <23a5f3>; proxy; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 5 regexps matched, 187 regexps total, 62 regexps cached, 0B scanned using pcre, 687B scanned total
postfix/qmgr[9633]: 633FA85126: from=, size=2621, nrcpt=1 (queue active)
redis[9205]: 10 changes in 300 seconds. Saving...
redis[9205]: Background saving started by pid 9859
redis[9859]: DB saved on disk
redis[9859]: RDB: 0 MB of memory used by copy-on-write
dovecot[9359]: lmtp(9860): Connect from local
postfix/lmtp[9858]: 633FA85126: to=, orig_to=<📧@kir.elagin.me>, relay=bruna.kir.elagin.me[/run/dovecot2/dovecot-lmtp], delay=0.57, delays=0.55/0.02/0.01/0, dsn=5.6.7, status=bounced (SMTPUTF8 is required, but was not offered by host bruna.kir.elagin.me[/run/dovecot2/dovecot-lmtp])
dovecot[9359]: lmtp(9860): Disconnect from local: Client has quit the connection (state=READY)
postfix/cleanup[9857]: C8AFA85127: message-id=<20210403160107.C8AFA85127@bruna.kir.elagin.me>
postfix/qmgr[9633]: C8AFA85127: from=<>, size=5706, nrcpt=1 (queue active)
postfix/bounce[9861]: 633FA85126: sender non-delivery notification: C8AFA85127
postfix/qmgr[9633]: 633FA85126: removed
redis[9205]: Background saving terminated with success
rspamd[9612]: ; proxy; proxy_milter_finish_handler: finished milter connection
postfix/smtpd[9849]: disconnect from mail-yb1-xb2f.google.com[2607:f8b0:4864:20::b2f] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
The interesting bits.
Dovecot:
dovecot[9359]: quota-status: Error: Client sent invalid recipient address `📧@kir.elagin.me': Invalid character in localpart
rspamd:
[10.00/15.00] [INVALID_RCPT_8BIT(6.00){},RCVD_ILLEGAL_CHARS(4.00){},TO_NEEDS_ENCODING(1.00){}
I did a quick search and it looks like support in Dovecot is still not implemented, e.g.: https://dovecot.org/pipermail/dovecot/2019-April/115399.html. And, furthermore, it looks like when Dovecot is used in the delivery chain it is recommended to disable SMTPUTF8 support in Postfix (which is enabled by default nowadays) to minimise potential damage and weirdness.
What makes all this much more sad is that not only UTF-8 recipients, but senders (apparently) are not supported too, e.g.: https://www.dovecot.org/pipermail/dovecot/2019-March/115286.html. They say it is being tracked as “DOP-1045” but I have no idea what this means, as I could not find anything that would look like an issue tracker for the project.
As for rspamd, I am not entirely sure what this INVALID_RCPT_8BIT
means, as I am not familiar with the code and I could not make sense of the test. Looks like rspamd does not support this either, e.g.: https://github.com/rspamd/rspamd/issues/1991, although this issue is quite old.