Subject: | RT 4.4 - Email::Address->parse unexpected results? |
Date: | Fri, 4 Mar 2016 10:19:13 +0000 |
To: | "bug-RT-Extension-LDAPImport-MultiEmail [...] rt.cpan.org" <bug-RT-Extension-LDAPImport-MultiEmail [...] rt.cpan.org> |
From: | Martin Weißbach (ICT) <Martin.Weissbach [...] om.org> |
Hi,
I tried to get the extension running under RT 4.4. In order to do that I did some minor modifications
like changing the '$self->_warn' lines to '$RT::Logger->warn' and so on. While doing that I came
across an interesting issue, which looks like a bug to me. I'm using Email::Address 1.908.
The Email::Address->parse() function is used to parse the mail addresses. The code looks like that:
41 my ($parsed) = Email::Address->parse($address);
42 unless ($parsed) {
43 $self->_debug("Skipping alternate address $address in $attrname of $email, as it is invalid");
44 next;
45 }
Now if $address is something like "smtp:some.name@example.com" it will pass the unless block.
Because of that all other parts using $address won't work properly, like in line 55:
55 $alt->LoadByEmail( $address );
Maybe I don't understand the code correctly. But isn't $parsed->as_string what you want instead of
$address, as in this example it contains the valid mail address "some.name@example.com"?
Thank you,
Cheers,
Martin
Show quoted text
________________________________
OM International Services (Carlisle) Ltd - Unit B Clifford Court, Cooper Way - Carlisle CA3 0JG - United Kingdom
Charity reg no: 1112655 - Company reg no: 5649412 (England and Wales)