By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,612 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,612 IT Pros & Developers. It's quick & easy.

Constructing MIME message without loading message stream

P: n/a
I would like to MIME encode a message from a large file without first
loading the file into memory. Assume the file has been pre-encoded on
disk (actually I am using encode_7or8bit, so the encoding should be
null). Is there a way to construct the flattened MIME message such that
data is streamed from the file as needed instead of being resident in
memory? Do I have to subclass the MIMEBase class myself?

Kris
Aug 9 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Kris Kennaway schrieb:
I would like to MIME encode a message from a large file without first
loading the file into memory. Assume the file has been pre-encoded on
disk (actually I am using encode_7or8bit, so the encoding should be
null). Is there a way to construct the flattened MIME message such that
data is streamed from the file as needed instead of being resident in
memory? Do I have to subclass the MIMEBase class myself?
I don't know what you are after here - but I *do* know that anything
above 10MB or so is most probably not transferable using mail, as MTAs
impose limits on message-sizes. Or in other words: usually, whatever you
want to encode should fit in memory as the network is limiting you.

If you insist, I guess the stdlib isn't much of help - try implementing
a SMTP-server using twisted. But this is just a guess.

Diez
Aug 10 '08 #2

P: n/a
Diez B. Roggisch wrote:
Kris Kennaway schrieb:
>I would like to MIME encode a message from a large file without first
loading the file into memory. Assume the file has been pre-encoded on
disk (actually I am using encode_7or8bit, so the encoding should be
null). Is there a way to construct the flattened MIME message such
that data is streamed from the file as needed instead of being
resident in memory? Do I have to subclass the MIMEBase class myself?

I don't know what you are after here - but I *do* know that anything
above 10MB or so is most probably not transferable using mail, as MTAs
impose limits on message-sizes. Or in other words: usually, whatever you
want to encode should fit in memory as the network is limiting you.
MIME encoding is used for other things than emails.

Kris
Aug 10 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.