-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Support chunk sending in smtplib #135952
Copy link
Copy link
Open
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancementA feature request or enhancement
Feature or enhancement
Proposal:
smtplib.SMTPcurrently has the methoddata(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 thisthat adds a parameter
data(msg : bytes, last : bool)that I am using in Koukan my mta project.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