Email:...r::Mbox(3pm)

πŸ“¦
version 0.860 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ Email::Folder::Mbox(3pm) πŸ¦‹

hii bestie so this is the manual page for the Perl module Email::Folder::Mbox, and it lives in the User Contributed Perl Documentation corner of the internet. she's little, she's focused, she reads mbox files. let's go πŸ’–


🌸 NAME 🌸

Email::Folder::Mbox β€” reads raw RFC822 mails from an mbox file. that's it, that's the whole personality, and honestly? obsessed. πŸ’…


πŸ‘‘ VERSION πŸ‘‘

version 0.860 ✨


πŸŽ€ SYNOPSIS πŸŽ€

short answer, no notes: This isa Email::Folder::Reader β€” read about its API there. periodt. πŸ’«


🌈 DESCRIPTION 🌈

Does exactly what it says on the tin, fr fr β€” it fetches raw RFC822 mails from an mbox. no more, no less, and we're not gonna pretend otherwise. 🫢

The mbox format is described at http://www.qmail.org/man/man5/mbox.html β€” go look, iykyk. πŸ“¬

So here's the tea: we attempt to read an mbox as though it's the mboxcl2 variant, and if there's no Content-Length header to be found anywhere, we fall back to regular mbox mode. lowkey humble of us. πŸ“

✨ OPTIONS ✨

The new constructor takes extra options. yes queen, she's configurable. πŸ‘‘

  • fh β€” when filename is set to FH then Email::Folder::Mbox will read the mbox archive from the filehandle fh instead of from the disk file filename. so like, filehandle energy instead of disk-file energy. πŸŽ€
  • 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". classic mac chaos, we've all been there. 😭
  • jwz_From_ β€” the value is taken as a boolean that governs what is used to match as a message separator.

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 β€” and bestie, this is the receipts, so i'm giving it to you verbatim:

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. πŸ’œ

  • unescape β€” this boolean value indicates whenever lines which start with
/^>+From /

should be unescaped (= the leading > char gets removed). This is needed for mboxrd and mboxcl variants. But there is no way to detect which mbox variant was used, so the default value is false. we simply cannot read minds, bestie. πŸ™ˆ

  • 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. 🌬️
  • next_message β€” this returns the next message as a string. πŸ“©
  • next_messageref β€” this returns the next message as a ref to string. πŸ”₯
  • tell β€” this returns the current filehandle position in the mbox. πŸ“
  • next_from β€” this returns the From_ line for the next message. call it before ->next_message. order matters, bestie!! ⭐
  • messageid β€” this returns the messageid of the last read message. call it after ->next_message. again: order. matters. πŸ‘‘

πŸ’– AUTHORS πŸ’–

the icons who made this happen:

  • Simon Wistow <simon@thegestalt.org> πŸŽ€
  • Richard Clamp <richardc@unixbeard.net> πŸ¦‹
  • Pali <pali@cpan.org> 🌟

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. so like, go forth and remix, we love that for you. πŸ’…


okay that's the whole page bestie, you ate it, you understood it, and for the record this was generated by perl v5.36.0 on 2022-10-14 β€” mwah, bye, go read some mbox files πŸ’–πŸŒˆβœ¨

πŸ“¦ where this page comes from