Subject: | bug in get_env_recipients routine of Email::Send::SMTP |
Date: | Sat, 13 Jun 2009 16:27:25 +0800 |
To: | bug-Email-Send [...] rt.cpan.org |
From: | John Maslanik <maz [...] mlx.net> |
It looks like two lines were added to the get_env_recipients routine
of the Email::Send::SMTP library. I'm not a perl monk, but it doesn't
seem to me that they would work under any circumstance:
sub get_env_recipients {
@@ -29,6 +30,8 @@ sub get_env_recipients {
my %to = map { $_->address => 1 }
map { Email::Address->parse($message->header($_)) }
+ grep { defined and length }
+ map { $message->header($_) }
qw(To Cc Bcc);
return keys %to;
So let me see if I read this correctly.
1. run $message->header($1) for To CC and Bcc. The results here will
be email addresses.
2. check if defined and has length
3. then run Email::Address->parse($message->header($_)) on email
addresses that were the results of the first map command. because of
the first map, $_ is set to email addresses, not the "To,Cc, and Bcc"
that I think it's expecting.
4. First map command never gets run.
I have just commeted out the grep and second map and everything seems
to be working.
John Maslanik.