Skip Menu |

This queue is for tickets about the MailTools CPAN distribution.

Report information
The Basics
Id: 82056
Status: resolved
Priority: 0/
Queue: MailTools

People
Owner: Nobody in particular
Requestors: filipe.goncalves [...] anubisnetworks.com
Cc:
AdminCc:

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



CC: perl [...] overmeer.net
Subject: [Bug] Mail::Address does not extract user correctly
Date: Mon, 17 Dec 2012 19:01:07 +0000
To: bug-MailTools [...] rt.cpan.org
From: Filipe Gonçalves <filipe.goncalves [...] anubisnetworks.com>
Good afternoon, I would like to report a bug in the Mail::Address perl module (part of the MailTools bundle). The user acessor is using index to retrieve the @ from which to call substr. Unfortunately, for valid emails such as "valid@email"@test.tld this acessor returns "valid as the user. Since hostnames, unlike the user bit, can never have the @ character in them, replacing index with rindex (like in the host accessor) solves this problem. It's just a matter of adding an r in line 269 of Mail/Address.pm Thanks -- Filipe Gonçalves AnubisNetworks Av. Quinta Grande, 53 Edifício Prime, 5ºA Alfragide 2610-156 AMADORA Mob : +351 91 058 8056 Tel : +351 21 725 2110 Fax : +351 21 725 2119 filipe.goncalves@anubisnetworks.com http://www.anubisnetworks.com
Subject: Re: [rt.cpan.org #82056] [Bug] Mail::Address does not extract user correctly
Date: Mon, 17 Dec 2012 20:09:23 +0100
To: Filipe Gonçalves via RT <bug-MailTools [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Filipe Gonçalves via RT (bug-MailTools@rt.cpan.org) [121217 19:01]: Show quoted text
> Mon Dec 17 14:01:23 2012: Request 82056 was acted upon. > Transaction: Ticket created by filipe.goncalves@anubisnetworks.com > Queue: MailTools > > Good afternoon,
Evening for me and you ;-) Show quoted text
> The user acessor is using index to retrieve the @ from which to call > substr. Unfortunately, for valid emails such as "valid@email"@test.tld > this acessor returns "valid as the user. Since hostnames, unlike the > user bit, can never have the @ character in them, replacing index with > rindex (like in the host accessor) solves this problem. It's just a > matter of adding an r in line 269 of Mail/Address.pm
The parser in Mail::Address is poor. Your suggestion does produce a little bit better result, so is accepted... but if you want a rfc compliant parser, then use Mail::Box::Field::Addresses -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #82056] [Bug] Mail::Address does not extract user correctly
Date: Mon, 17 Dec 2012 19:13:57 +0000
To: bug-MailTools [...] rt.cpan.org
From: Filipe Gonçalves <filipe.goncalves [...] anubisnetworks.com>
Good evening indeed, actually, I'm using Mail::Address indirectly, from Email::Valid, but thanks for the suggestion. On 17-12-2012 19:09, Mark Overmeer via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=82056 > > > * Filipe Gonçalves via RT (bug-MailTools@rt.cpan.org) [121217 19:01]:
>> Mon Dec 17 14:01:23 2012: Request 82056 was acted upon. >> Transaction: Ticket created by filipe.goncalves@anubisnetworks.com >> Queue: MailTools >> >> Good afternoon,
> Evening for me and you ;-) >
>> The user acessor is using index to retrieve the @ from which to call >> substr. Unfortunately, for valid emails such as "valid@email"@test.tld >> this acessor returns "valid as the user. Since hostnames, unlike the >> user bit, can never have the @ character in them, replacing index with >> rindex (like in the host accessor) solves this problem. It's just a >> matter of adding an r in line 269 of Mail/Address.pm
> The parser in Mail::Address is poor. Your suggestion does produce > a little bit better result, so is accepted... but if you want a > rfc compliant parser, then use Mail::Box::Field::Addresses
-- Filipe Gonçalves AnubisNetworks Av. Quinta Grande, 53 Edifício Prime, 5ºA Alfragide 2610-156 AMADORA Mob : +351 91 058 8056 Tel : +351 21 725 2110 Fax : +351 21 725 2119 filipe.goncalves@anubisnetworks.com http://www.anubisnetworks.com
Not changed for backwards compatibility. Alternatice available