aiosmtpd icon indicating copy to clipboard operation
aiosmtpd copied to clipboard

Possible standards violation: SMTPUTF8 and 8BITMIME

Open pepoluan opened this issue 4 years ago • 2 comments

Was reading RFC 6531 and came upon Section 3.1 which explicitly states:

  1. Servers offering this extension MUST provide support for, and announce, the 8BITMIME extension [RFC6152].

Now if I initialize SMTP with enable_SMTPUTF8=True and decode_data=True, then the EHLO session returns:

b'220 MY-LAPTOP Python SMTP 1.2.3a2\r\n'
b'250-MY-LAPTOP\r\n'
b'250-SIZE 33554432\r\n'
b'250-SMTPUTF8\r\n'
b'250 HELP\r\n'

which is in violation of RFC 6531 § 3.1 number 8 above.

There's also a bit of complexity w.r.t. mail body itself (i.e., data following the DATA command); RFC 6531 § 3.6 specifies that

... The SMTPUTF8 extension MAY be used as follows (assuming it is appropriate given the body content):

  • with the BODY=8BITMIME parameter [RFC6152], or

  • with the BODY=BINARYMIME parameter, if the SMTP server advertises BINARYMIME [RFC3030].

This will require some rethinking on the logic behind enable_SMTPUTF8 and decode_data

pepoluan avatar Dec 07 '20 05:12 pepoluan

This might have some interaction with #217

pepoluan avatar Dec 07 '20 06:12 pepoluan

As with #217, fixing this will likely break things.

I'm deferring this to "2.0" milestone.

pepoluan avatar Dec 26 '20 19:12 pepoluan