| Email::Folder::Mbox(3pm) | User Contributed Perl Documentation | Email::Folder::Mbox(3pm) |
Email::Folder::Mbox - reads raw RFC822 mails from an mbox file
version 0.860
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 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.
The new constructor takes extra options.
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 "\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 there's nothing
after that. But you can't rely on any of this.
Defaults to false.
/^>+From /
should be unescaped (= removed leading '>' char). This is needed for mboxrd and mboxcl variants. But there is no way to detect for used mbox variant, so default value is false.
This software is copyright (c) 2006 by Simon Wistow.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| 2022-10-14 | perl v5.36.0 |