Subject: | Problems with overruling addresses using destinations() |
Mail-box-2.096
Perl 5.10.0
Linux 2.6.30.1-m64-mb1 #2 SMP x86_64 GNU/Linux
I am having trouble with Mail::Transport::Send->destinations() which I
believe to be a bug. The following code sends an email to
"andy@andybev.com", whereas I would expect it to send to "mail@andybev.com"
use Mail::Message;
use Mail::Transport::SMTP;
$msg = Mail::Message->build
( From => 'andy@andybev.com'
, To => 'andy@andybev.com'
, Subject => "Test message"
, data => "Test body"
);
my $sender = Mail::Transport::SMTP->new();
$sender->destinations($msg, 'mail@andybev.com');
$sender->send($msg);
I have looked at the code to try and rectify the problem, but my perl
knowledge is not good enough. However, as an additional point, I did
notice that in Sendmail.pm the code is not suitable for destinations()
anyway - the sendmail binary is called with '-t'. I believe that
Sendmail should only be called with '-t' if the recipient addresses have
not been overruled.
So, there appears to be 2 related bugs: the destinations() parameter
does not function as expected for *all* mailer transports, and Sendmail
should not always be called with '-t'.
Thanks,
Andy