Subject: | Bug report: Wrong sender seting in Mail::Mailer::smtp |
Date: | Sat, 12 May 2012 10:02:44 -0000 |
To: | bug-MailTools [...] rt.cpan.org |
From: | "Vladimir Goshev" <sunx [...] sunx.name> |
Hello!
Sorry for my English.
In Mail::Mailer::smtp module i found a bug (or i think so). If i pass
"From" parameter to Mail::Internet->send function, then my SMTP server
says following:
Net::SMTP=GLOB(0x20e9ab8)>>> MAIL FROM:<root@Merry>#015
Net::SMTP=GLOB(0x20e9ab8)<<< 250 OK
Net::SMTP=GLOB(0x20e9ab8)>>> MAIL FROM:<sunx_test@sunx.name>#015
Net::SMTP=GLOB(0x20e9ab8)<<< 503 sender already given
So, module try to set sender mail twice.
I hope following patch should fix this problem:
diff -ur MailTools-2.09.orig/lib/Mail/Mailer/smtp.pm
MailTools-2.09/lib/Mail/Mailer/smtp.pm
--- MailTools-2.09.orig/lib/Mail/Mailer/smtp.pm 2012-02-25
17:47:44.000000000 +0400
+++ MailTools-2.09/lib/Mail/Mailer/smtp.pm 2012-05-12
13:45:35.134355523 +0400
@@ -32,8 +32,7 @@
${*$self}{sock} = $smtp;
- $smtp->mail(mailaddress);
- $smtp->mail($opt{From}) if $opt{From};
+ $smtp->mail($opt{From} ? $opt{From} : mailaddress);
$smtp->to($_) for @$to;
$smtp->data;
I think Mail::Mailer::smtps module has same problem with same solution
--
Best regards
Vladimir Goshev