Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Send CPAN distribution.

Report information
The Basics
Id: 34361
Status: resolved
Priority: 0/
Queue: Email-Send

People
Owner: Nobody in particular
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.192
Fixed in: (no value)



Subject: Uninitialized $mailer in Email::Send::Sendmail
The Email::Send::Sendmail::send() method has this code: my $mailer = $class->_find_sendmail; return failure "Found $mailer but cannot execute it" unless -x $mailer; But _find_sendmail() can return undef, which causes uninitialized warnings for the string interpolation and for the -x.
More important that error issued is incorrect and tells nothing useful about actual problem. Here is patch that adds additional check. Please, apply and release a new version. On Sat Mar 22 22:35:32 2008, CDOLAN wrote: Show quoted text
> The Email::Send::Sendmail::send() method has this code: > > my $mailer = $class->_find_sendmail; > return failure "Found $mailer but cannot execute it" > unless -x $mailer; > > > But _find_sendmail() can return undef, which causes uninitialized > warnings for the string interpolation and for the -x.
-- Best regards, Ruslan.
diff -ur Email-Send-2.192/lib/Email/Send/Sendmail.pm Email-Send-2.192-my/lib/Email/Send/Sendmail.pm --- Email-Send-2.192/lib/Email/Send/Sendmail.pm 2007-07-29 16:50:21.000000000 +0400 +++ Email-Send-2.192-my/lib/Email/Send/Sendmail.pm 2008-12-20 04:46:17.000000000 +0300 @@ -36,6 +36,10 @@ my ($class, $message, @args) = @_; my $mailer = $class->_find_sendmail; + return failure "Couldn't find 'sendmail' executable in your PATH" + ." and \$".__PACKAGE__."::SENDMAIL is not set" + unless $mailer; + return failure "Found $mailer but cannot execute it" unless -x $mailer;
git commit fd52e2f894072fb6afcd0a9ae10cbbac4601b118 -- rjbs