Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: recommended storage format for email messages?

by hangon (Deacon)
on Jul 14, 2009 at 21:18 UTC ( #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
Node Status?
node history
Node Type: note [id://780078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2016-08-26 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (366 votes). Check out past polls.