Forward the content of this message. The body of the message to be forwarded
is encapsulated in some accompanying text (if you have no wish for that, than
bounce is your choice). A Mail::Message object is returned on success.
You may forward a whole message, but also message parts. You may wish to overrule some of the default header settings for the reply immediately, or you may do that later with set on the header.
When a multi-part body is encountered, and the message is included to ATTACH, the parts which look like signatures will be removed. If only one message remains, it will be the added as single attachment, otherwise a nested multipart will be the result. The value of this option does not matter, as long as it is present. See Mail::Message::Body::Multipart.
Forward the message as flat attachment to the specified preamble. You
can specify all options available to forward(), although a preamble
which is provided as body object is required, and any specified body
Like forwardAttach(), but in this case the original message is first
encapsulated as nested message in a Mail::Message::Body::Nested, and
then joint into a multipart.
You can specify all options available to forward(), although a preamble which is provided as body object is required, and any specified body is ignored. Signatures are not stripped. Signatures are not stripped.
This method is equivalent in behavior to forward() with the
option include set to INLINE. You can specify most of
the fields which are available to forward() except
include and body.
Construct a forward, where the whole body of the message is already
constructed. That complex body is usually produced in forwardInline(),
forwardAttach(), or forwardEncapsulate().
The OPTIONS are the same as for forward() except that body is required. Some other options, like preamble, are ignored.
Added after the forwarded message.
Create a few lines to be included before the forwarded message
content. The return is an array of lines.
Create a subject for a message which is a forward from this one. This routine
tries to count the level of reply in subject field, and transform it into
a standard form. Please contribute improvements.
The main difference between bounce() and forward() is the reason for message processing. The bounce has no intention to modify the content of message: the same information is passed-on to someplace else. This may mean some conversions, but for instance, the Message-ID does not need to be changed.
The purpose of forward() is to pass on information which is modified: annotated or reduced. The information is not sent back to the author of the original message (which is implemented by reply()), but to someone else.
So: some information comes in, is modified, and than forwarded to someone else. Currently, there are four ways to get the original information included, which are explained in the next sections.
After the creation of the forward, you may want to rebuild() the message to remove unnecessary complexities. Of course, that is not required.
forward, specify a body
When you specify forward(body), you have created your own body object to be used as content of the forwarded message. This implies that forward(include) is NO: no automatic generation of the forwarded body.
forward, inline the original
The forward(include) is set to INLINE (the default) This is the most complicated situation, but most often used by MUAs: the original message is inserted textually in the new body. You can set-up automatic stripping of signatures, the way of encapsulation, and texts which should be added before and after the encapsulated part.
However, the result may not always be what you expect. For instance, some people use very long signatures which will not be automatically stripped because the pass the threshold. So, you probably need some manual intervention after the message is created and before it is sent.
When a binary message is encountered, inlining is impossible. In that case, the message is treated as if ENCAPSULATE was requested.
forward, attach the original
When forward(include) is explicitly set to ATTACH the result will be a multipart which contains two parts. The first part will be your message, and the second the body of the original message.
This means that the headers of the forwarded message are used for the new message, and detached from the part which now contains the original body information. Content related headers will (of course) still be part of that part, but lines line To and Subject will not be stored with that part.
As example of the structural transformation:
# code: $original->printStructure; multipart/alternative: The source message text/plain: content in raw text text/html: content as html # code: $fwd = $original->forward(include => ATTACH); # code: $fwd->printStructure multipart/mixed: The source message text/plain: prelude/postlude/signature multipart/alternative text/plain: content in raw text text/html: content as html
forward, encapsulate the original
When forward(include) is explicitly set to ENCAPSULATE, then the original message is left in-tact as good as possible. The lines of the original message are used in the main message header but also enclosed in the part header.
The encapsulation is implemented using a nested message, content type message/rfc822. As example of the structural transformation:
# code: $original->printStructure; multipart/alternative: The source message text/plain: content in raw text text/html: content as html # code: $fwd = $original->forward(include => ENCAPSULATE); # code: $fwd->printStructure multipart/mixed: The source message text/plain: prelude/postlude/signature message/rfc822 multipart/alternative: The source message text/plain: content in raw text text/html: content as html
The message structure is much more complex, but no information is lost. This is probably the reason why many MUAs use this when the forward an original message as attachment.
Error: Cannot include forward source as $include. Unknown alternative for the forward(include). Valid choices are NO, INLINE, ATTACH, and ENCAPSULATE. Error: Method forwardAttach requires a preamble Error: Method forwardEncapsulate requires a preamble Error: No address to create forwarded to. If a forward message is created, a destination address must be specified.
This module is part of Mail-Box distribution version 2.109, built on August 19, 2013. Website: http://perl.overmeer.net/mailbox/
Copyrights 2001-2013 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
|perl v5.20.3||MAIL::MESSAGE::CONSTRUCT::FORWARD (3)||2013-08-19|