Hi ,
Starting from aiosmtpd v1.4.5 (and still present in v1.4.6), message bodies received by the SMTP handler are incorrectly dot-stuffed — each line beginning with a . in the DATA section gets an extra dot prepended (..) when accessed in envelope.content.
This behaviour was not present in v1.4.4.post2, where dot-unstuffing worked correctly.
Test Code
(Attached in the issue)
The test sends the following message body containing two dots on a single line:
msg = b"""this is a test of dot
..
"""
Results
✅ v1.4.4.post2 (correct behaviour)
data: (354, b'End data with <CR><LF>.<CR><LF>')
send: b'this is a test of dot\n...\n\r\n.\r\n' <- dot-stuffed during send (expected)
b'this is a test of dot\n..\n\r\n' <- correctly unstuffed (2 dots)
❌ v1.4.5+ (incorrect behaviour)
data: (354, b'End data with <CR><LF>.<CR><LF>')
send: b'this is a test of dot\n...\n\r\n.\r\n' <- dot-stuffed during send (expected)
b'this is a test of dot\n...\n\r\n' <- not unstuffed (3 dots) ❌
Thanks!
Hi ,
Starting from aiosmtpd v1.4.5 (and still present in v1.4.6), message bodies received by the SMTP handler are incorrectly dot-stuffed — each line beginning with a
.in theDATAsection gets an extra dot prepended (..) when accessed inenvelope.content.This behaviour was not present in v1.4.4.post2, where dot-unstuffing worked correctly.
Test Code
(Attached in the issue)
The test sends the following message body containing two dots on a single line:
Results
✅ v1.4.4.post2 (correct behaviour)
❌ v1.4.5+ (incorrect behaviour)
Thanks!