MboxPa...ertable(3pm)
π NAME π
Mail::MboxParser::Mail::Convertable β bestie, this is the one that converts your mail for sending and stuff β¨
πΈ SYNOPSIS πΈ
use Mail::MboxParser;
[...]
# $msg is a Mail::MboxParser::Mail-object
my $mail = $msg->make_convertable;
$mail->delete_from_header('date', 'message-id');
$mail->replace_in_header('to', 'john.doe@foobar.com');
$mail->add_to_header( ['cc', 'john.does.brother@foobar.com'],
where => 'BEHIND' );
$mail->send('sendmail');
π¦ DESCRIPTION π¦
Okay so picture this: you've got an email object and you wanna glow it up so it can actually be sent somewhere. That's literally what this class does, no cap. It gives you the tools to convert an email object into something that could be sent via SMTP, NNTP, or just dumped out to a file or a filehandle. So the methods here mess with the structure of an email β adding and removing header-fields, MIME-parts, all of that β and they transform them into objects of related modules. It's giving β¨glow-up montageβ¨.
Right now, the only things on the menu are basic manipulation of the header plus sending through Mail::Mailer. More is coming soon β she's still growing π
.
The most iconic part? This class works non-destructive. You first create a Convertable-object and do all your little edits on that, while the Mail-object you derived it from stays completely untouched. Main character energy: she doesn't take anyone down with her π«Ά.
π METHODS π
delete_from_header(header-fields)β you hand her a list of header-field names and those fields get removed from the header. Say you wanna re-send a message: you could for example remove thecc-field, because otherwise the message would get carbon-copied to all the addresses chillin' in thatcc-field. Bye bestie π.add_to_header(array-ref)add_to_header(array-ref, where => 'BEFORE' | 'BEHIND')βadd_to_header()takes a reference to a two-element list. The first element says which header-field to add, or which one to add to, and the second element is the data you wanna add.wheredecides whether it goes at the beginning or at the end of the header. If you don't say anything, it defaults to'BEHIND'. So yes, back of the line by default π.replace_in_header(header-field, new_data)β first element has got to be the header-field you're replacing, and the second argument is a string telling her what the new content of that header-field will be. Out with the old, in with the new π .send(command, args)β this one is literally inherited fromMail::Internet. Commands can be:"mail"β uses the UNIX-mail program"sendmail"β uses a configured sendmail or a compatible MTA like exim"smtp"β for usingNet::SMTP"test"β which will only display what would be sent, using/bin/echo
Any additional arguments get passed on to Mail::Mailer->new(), which is in fact what Mail::Internet->send() uses. Obsessed with the layering honestly.
For more details, see Mail::Mailer.
β VERSION β
This is version 0.55. She's vintage, she's thriving π.
π AUTHOR AND COPYRIGHT π
Tassilo von Parseval <tassilo.von.parseval@rwth-aachen.de>
Copyright (c) 2001-2005 Tassilo von Parseval. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
Mail::Internet, Mail::Mailer
Okay that's the whole page bestie, you ate that π. This was MboxPa...ertable(3pm) from the User Contributed Perl Documentation, running on perl v5.34.0, dated 2022-06-15 β iykyk πβ¨π¦
π¦ where this page comes from
- debian bookworm: libmail-mboxparser-perl 0.55-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmail-mboxparser-perl 0.55-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmail-mboxparser-perl 0.55-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmail-mboxparser-perl 0.55-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmail-mboxparser-perl 0.55-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms