Constructing MIME message without loading message stream

K

Kris Kennaway

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
 
D

Diez B. Roggisch

Kris said:
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
 
K

Kris Kennaway

Diez said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top