Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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: <> Received: from To: Subject: file format Date: Tue, 14 Jul 2009 16:00:18 -0400 email message body bla bla bla etc ... etc ... etc ... 729 Return-Path: <> Received: ... Date: Tue, 14 Jul 2009 16:00:18 -0400 another email bla bla bla etc ...

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-10-23 15:25 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.