.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MboxParser::Mail::Convertable 3pm" .TH MboxParser::Mail::Convertable 3pm "2022-06-15" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mail::MboxParser::Mail::Convertable \- convert mail for sending etc. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Mail::MboxParser; \& \& [...] \& \& # $msg is a Mail::MboxParser::Mail\-object \& my $mail = $msg\->make_convertable; \& \& $mail\->delete_from_header(\*(Aqdate\*(Aq, \*(Aqmessage\-id\*(Aq); \& $mail\->replace_in_header(\*(Aqto\*(Aq, \*(Aqjohn.doe@foobar.com\*(Aq); \& $mail\->add_to_header( [\*(Aqcc\*(Aq, \*(Aqjohn.does.brother@foobar.com\*(Aq], \& where => \*(AqBEHIND\*(Aq ); \& $mail\->send(\*(Aqsendmail\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class adds means to convert an email object into something that could be send via \s-1SMTP, NNTP\s0 or dumped to a file or filehandle. Therefore, methods are provided that change the structure of an email which includes adding and removing of header-fields, MIME-parts etc and transforming them into objects of related modules. .PP Currently, only basic manipulation of the header and sending using Mail::Mailer is provided. More is to come soon. .PP This class works non-destructive. You first create a Convertable-object and do any modifications on this while the Mail-object from which it was derived will not be touched. .SH "METHODS" .IX Header "METHODS" .IP "delete_from_header(header\-fields)" 4 .IX Item "delete_from_header(header-fields)" Given a list of header-field names, these fields will be removed from the header. If you want to re-send a message, you could for instance remove the cc-field cause otherwise the message would be carbon-copied to the addresses listed in the cc-field. .IP "add_to_header(array\-ref)" 4 .IX Item "add_to_header(array-ref)" .PD 0 .IP "add_to_header(array\-ref, where => '\s-1BEFORE\s0' | '\s-1BEHIND\s0')" 4 .IX Item "add_to_header(array-ref, where => 'BEFORE' | 'BEHIND')" .PD \&\fBadd_to_header()\fR takes a reference to a two-element list whose first element specifies the header-field to add or to add to while the second elements specifies the data that should be added. 'where' specifies whether to add at the beginning or at the end of the header. Defaults to '\s-1BEHIND\s0' if not given. .IP "replace_in_header(header\-field, new_data)" 4 .IX Item "replace_in_header(header-field, new_data)" First element must be the header-field to be replaced while the second argument must be a string indicating what will be the new content of the header-field. .IP "send(command, args)" 4 .IX Item "send(command, args)" Literally inherited from Mail::Internet. Commands can be \*(L"mail\*(R" (using the UNIX-mail program), \*(L"sendmail\*(R" (using a configured sendmail or compatible \s-1MTA\s0 like exim), \*(L"smtp\*(R" (for using Net::SMTP) and \*(L"test\*(R" which will only display what would be sent using /bin/echo. Additional arguments will be passed on to Mail::Mailer\->\fBnew()\fR which is in fact what Mail::Internet\->\fBsend()\fR uses. .Sp For more details, see Mail::Mailer .SH "VERSION" .IX Header "VERSION" This is version 0.55. .SH "AUTHOR AND COPYRIGHT" .IX Header "AUTHOR AND COPYRIGHT" Tassilo von Parseval .PP 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. .SH "SEE ALSO" .IX Header "SEE ALSO" Mail::Internet, Mail::Mailer