mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-07 17:47:14 +00:00
mda-lmtp: Add -to_puny, to punycode-encode addresses
Some LMTP servers (like dovecot) can't handle UTF8 addresses in the LMTP commands. This can be problematic if we want to use them with UTF8 domains or usernames, which are well supported by chasquid. To help workaround this issue, this patch adds a new -to_puny flag for mda-lmtp, that makes it encode `from` and `recipient` in punycode. That way, the server will get punycode-encoded (ASCII) strings in the LTMP commands. This can be particularly convenient when the recipients are ASCII (because they're under the mail server control), but `from` may not be (because it comes from the network).
This commit is contained in:
9
cmd/mda-lmtp/test_puny_invalid.cmy
Normal file
9
cmd/mda-lmtp/test_puny_invalid.cmy
Normal file
@@ -0,0 +1,9 @@
|
||||
mda = ./mda-lmtp --addr=.test-sock --addr_network=unix \
|
||||
-to_puny -f fröm -d xn--t < test-email
|
||||
mda <- cannot puny-encode recipient: idna: invalid label "t"
|
||||
mda wait 2
|
||||
|
||||
mda = ./mda-lmtp --addr=.test-sock --addr_network=unix \
|
||||
-to_puny -f xn--f -d to < test-email
|
||||
mda <- cannot puny-encode from: idna: invalid label "f"
|
||||
mda wait 2
|
||||
Reference in New Issue
Block a user