Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

email::folder::mbox(3pm) [debian man page]

Email::Folder::Mbox(3pm)				User Contributed Perl Documentation				  Email::Folder::Mbox(3pm)

NAME
Email::Folder::Mbox - reads raw RFC822 mails from an mbox file SYNOPSIS
This isa Email::Folder::Reader - read about its API there. DESCRIPTION
Does exactly what it says on the tin - fetches raw RFC822 mails from an mbox. The mbox format is described at http://www.qmail.org/man/man5/mbox.html 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. OPTIONS The new constructor takes extra options. "eol" This indicates what the line-ending style is to be. The default is " ", 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 <http://www.jwz.org/doc/content-length.html> 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 " From .* " except for the very first message in the file, where it is "^From .* ". 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 there's nothing after that. But you can't 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. AUTHORS
Simon Wistow <simon@thegestalt.org> Richard Clamp <richardc@unixbeard.net> COPYING
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. SEE ALSO
Email::LocalDelivery, Email::Folder perl v5.10.0 2009-07-27 Email::Folder::Mbox(3pm)

Check Out this Related Man Page

Email::Folder(3pm)					User Contributed Perl Documentation					Email::Folder(3pm)

NAME
Email::Folder - read all the messages from a folder as Email::Simple objects. SYNOPSIS
use Email::Folder; my $folder = Email::Folder->new("some_file"); print join " ", map { $_->header("Subject") } $folder->messages; METHODS
new($folder, %options) Takes the name of a folder, and a hash of options If a 'reader' option is passed in then that is used as the class to read in messages with. messages Returns a list containing all of the messages in the folder. Can only be called once as it drains the iterator. next_message acts as an iterator. reads the next message from a folder. returns false at the end of the folder bless_message($message) Takes a raw RFC822 message and blesses it into a class. By default this is an Email::Simple object but can easily be overriden in a subclass. For example, this simple subclass just returns the raw rfc822 messages, and exposes the speed of the parser. package Email::RawFolder; use base 'Email::Folder'; sub bless_message { $_[1] }; 1; reader read-only accessor to the underlying Email::Reader subclass instance PERL EMAIL PROJECT
This module is maintained by the Perl Email Project <http://emailproject.perl.org/wiki/Email::Folder> AUTHORS
Simon Wistow <simon@thegestalt.org> Richard Clamp <richardc@unixbeard.net> COPYING
Copyright 2006, 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 doobie brothers. SEE ALSO
Email::LocalDelivery, Email::FolderType, Email::Simple perl v5.10.0 2009-07-27 Email::Folder(3pm)
Man Page