Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  EMAIL::FOLDER::MBOX (3)

.ds Aq ’


Email::Folder::Mbox - reads raw RFC822 mails from an mbox file



This isa Email::Folder::Reader - read about its API there.


Does exactly what it says on the tin - fetches raw RFC822 mails from an mbox.

The mbox format is described at

We attempt to read an mbox as through it’s the mboxcl2 variant, falling back to regular mbox mode if there is no Content-Length header to be found.


The new constructor takes extra options.
eol This indicates what the line-ending style is to be. The default is "\n", but for handling files with mac line-endings you would want to specify eol => "\x0d"
jwz_From_ The value is taken as a boolean that governs what is used match as a message seperator.

If false we use the mutt style

 /^From \S+\s+(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)/
 /^From (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)/;

If true we use

 /^From /

In deference to this extract from <>

 Essentially the only safe way to parse that file format is to
 consider all lines which begin with the characters ``From 
 (From-space), which are preceded by a blank line or
 beginning-of-file, to be the division between messages.  That is, the
 delimiter is "\n\nFrom .*\n" except for the very first message in the
 file, where it is "^From .*\n".

 Some people will tell you that you should do stricter parsing on
 those lines: check for user names and dates and so on.  They are
 wrong.  The random crap that has traditionally been dumped into that
 line is without bound; comparing the first five characters is the
 only safe and portable thing to do. Usually, but not always, the next
 token on the line after ``From  will be a user-id, or email
 address, or UUCP path, and usually the next thing on the line will be
 a date specification, in some format, and usually theres nothing
 after that.  But you cant rely on any of this.

Defaults to false.

seek_to Seek to an offset when opening the mbox. When used in combination with ->tell you may be able to resume reading, with a trailing wind.
tell This returns the current filehandle position in the mbox.


Simon Wistow <>

Richard Clamp <>


Copyright 2003, Simon Wistow

Distributed under the same terms as Perl itself.

This software is under no warranty and will probably ruin your life, kill your friends, burn your house and bring about the apocolapyse.


Email::LocalDelivery, Email::Folder
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 EMAIL::FOLDER::MBOX (3) 2009-07-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.