| Mail::Message::Construct::Bounce(3pm) | User Contributed Perl Documentation | Mail::Message::Construct::Bounce(3pm) |
Mail::Message::Construct::Bounce - bounce a Mail::Message
$message->bounce(To => 'you')->send;
Complex functionality on Mail::Message objects is implemented in different files which are autoloaded. This file implements the functionality related to bouncing messages off to other destinations.
Be warned: bouncing messages was very common practice in the past, but does not play well together with SPF spam protection. Unless you bounce messages which originate from inside your own infrastructure, you may get the message rejected by the spam-filters of the receivers. The way around it, is to implement ARC... which the MailBox suite did not try (yet).
When a message is received, the Mail Transfer Agent (MTA) adds a "Received" field to the header. As %options, you may specify lines which are added to the resent group of that received field. "Resent-*" is prepended before the field-names automatically, unless already present.
You may also specify an instantiated Mail::Message::Head::ResentGroup (RG) object. See Mail::Message::Head::ResentGroup::new() for the available options. This is required if you want to add a new resent group: create a new "Received" line in the header as well.
If you are planning to change the body of a bounce message, don't! Bounced messages have the same message-id as the original message, and therefore should have the same content (message-ids are universally unique). If you still insist, use Mail::Message::body().
example:
my $bounce = $folder->message(3)->bounce(To => 'you', Bcc => 'everyone'); $bounce->send; $outbox->addMessage($bounce); my $rg = Mail::Message::Head::ResentGroup->new(To => 'you', Received => 'from ... by ...'); $msg->bounce($rg)->send;
This module is part of Mail-Message distribution version 3.017, built on April 18, 2025. Website: http://perl.overmeer.net/CPAN/
Copyrights 2001-2025 by [Mark Overmeer <markov@cpan.org>]. 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://dev.perl.org/licenses/
| 2025-04-25 | perl v5.40.1 |