Skip to content

Extra dot added to message lines (dot-stuffing not unstuffed correctly since v1.4.5+) #561

@miaoz2001

Description

@miaoz2001

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions