Subject: | Allow setting of envelope sender in ::SMTP |
Email::Send::SMTP currently uses the email address in the 'From' header
as the reverse-path in the SMTP transaction for the 'MAIL FROM' command.
It is desirable to be able to change that. You can, for example, set it
to an address which is set up to process bounces.
I attach a patch which allows you to specify the reverse-path in the
'from' mailer_arg. If not specified, the current behaviour is maintainted.
Regards,
Simon
Subject: | SMTP-custom-MAIL_FROM.diff |
--- lib/Email/Send/SMTP.pm.orig Thu Jul 6 13:52:12 2006
+++ lib/Email/Send/SMTP.pm Thu Jul 6 16:07:08 2006
@@ -55,5 +55,5 @@
my @to;
eval {
- my $from =
+ my $from = $args{from} ||
(Email::Address->parse($message->header('From')))[0]->address;
$SMTP->mail($from) or return failure "FROM: <$from> denied";
@@ -117,4 +117,7 @@
used to invoke C<< Net::SMTP->auth() >> for SASL authentication support.
C<ssl>, if set to true, turns on SSL support by using C<Net::SMTP::SSL>.
+C<from> may be used set to the reverse-path used for the SMTP transaction.
+If you do not specify a value for C<from>, the reverse-path will be set
+to the email address in the C<From> header.
SMTP can fail for a number of reasons. All return values from this