Support chunk sending in `smtplib` · Issue #135952 · python/cpython · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Support chunk sending in smtplib #135952

Open
@jsbucy

Description

@jsbucy

Feature or enhancement

Proposal:

smtplib.SMTP currently has the method data(msg : Union[bytes, str]) to send the message which takes the entire serialized rfc822 message as bytes or str. Email messages can be pretty large -- 10M or more. So it would be nice to be able to send the message in chunks without having to bring it all into the python heap at once. I have a proof-of-concept of this
that adds a parameter data(msg : bytes, last : bool) that I am using in Koukan my mta project.

smtp.data(b'hello\r\n', last=False)
smtp.data(b'world!\r\n', last=True)

I wanted to see if there was any interest in merging this. Building on this, I have another patch to add support for rfc3030 CHUNKING/BDAT which is maybe a separate discussion but if we extend the api here, it ought to be able to support both dotstuff and bdat transparently.

In parallel with this, I am trying to make the corresponding change to aiosmtpd

Has this already been discussed elsewhere?

https://discuss.python.org/t/smtplib-chunked-sending/96804

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usagestdlibPython modules in the Lib dirtopic-emailtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.