Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: recommended storage format for email messages?

by hangon (Deacon)
on Jul 14, 2009 at 21:18 UTC ( [id://780078]=note: print w/replies, xml ) Need Help??


in reply to recommended storage format for email messages?

A quick and dirty method I've used is to add a fixed length ascii field before each message. The field contains the message length in bytes. Then concat the messages with length field into a single file. To traverse, use read to get the message length, then read to grab the entire message or seek to the next one. The format is fairly trivial to code as long as your file will be used readonly. Note that it may not be portable to a different OS.

1148 Return-Path: <user@foo.com> Received: from someone@wherever.com To: me@email.com Subject: file format Date: Tue, 14 Jul 2009 16:00:18 -0400 email message body bla bla bla etc ... etc ... etc ... 729 Return-Path: <user@foo.com> Received: ... Date: Tue, 14 Jul 2009 16:00:18 -0400 another email bla bla bla etc ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://780078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2025-04-28 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.