Don't MIME-encode RFC822 mailbox local parts

This is explicilty disallowed by RFC 2074 §5 and not accepted by mail
servers.

See #336
This commit is contained in:
Michael Gratton 2019-04-24 20:43:39 +10:00
parent c306c2c5fa
commit 534b4e27d9
2 changed files with 16 additions and 5 deletions

View file

@ -238,6 +238,15 @@ class Geary.RFC822.MailboxAddressTest : TestCase {
new MailboxAddress(null, "test@test@example.com").to_rfc822_address()
);
// RFC 2047 reserved words in the local-part must be used
// as-is, and in particular not encoded per that RFC. See RFC
// 2047 §5 and GNOME/geary#336
string RFC_2074 = "libc-alpha-sc.1553427554.ndgdflaalknmibgfkpak-hi-angel=yandex.ru@sourceware.org";
assert_string(
RFC_2074,
new MailboxAddress(null, RFC_2074).to_rfc822_address()
);
// Likewise, Unicode chars should be passed through. Note that
// these can only be sent if a UTF8 connection is negotiated
// with the SMTP server