Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Constructing MIME message without loading message stream

Reply
Thread Tools

Constructing MIME message without loading message stream

 
 
Kris Kennaway
Guest
Posts: n/a
 
      08-09-2008
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
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      08-10-2008
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
 
Reply With Quote
 
 
 
 
Kris Kennaway
Guest
Posts: n/a
 
      08-10-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
constructing vector<POD> that is member of a class from an input stream (file) Hicham Mouline C++ 3 11-18-2009 04:17 PM
Constructing a URI that uses a stream as input Qu0ll Java 0 07-04-2009 03:40 PM
constructing objects from a stream jesper@alphacash.se C++ 1 02-23-2006 08:40 AM
tomcat 4.x : setting mime type for a directory or setting a default mime type CJ Java 1 10-29-2004 07:51 PM
Receiving zip files via Mime::Parser/Mime::Decoder Jan Arickx Perl Misc 0 08-25-2003 08:24 PM



Advertisments