Skip Menu |

This queue is for tickets about the MailTools CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: ELACOUR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.02
  • 2.03
Fixed in: (no value)



Subject: Mail::Address fail to parse rfc822 multiple mailboxes names
Hi, in rfc 822 [1], chapter 6.2.6, it is specified that an address can be a "pseudo" group address like 'name:;' If you parse such address with Mail::Address->parse, it removes the ending ";" which is really important because this is what is used by the MTA to understand this as a pseudo address and to not send mail to it. The following sample code triggers this bug: -----snip----- #!/usr/bin/perl -w use strict; use Mail::Address; my $header = '"AdminCc of example.com Ticket #6":;'; my @addresses = Mail::Address->parse($header); foreach my $addr (@addresses) { print $addr->address."\n"; } -----snip----- Print: "AdminCc of example.com Ticket #6": but should print: "AdminCc of example.com Ticket #6":; The attached patch makes it working, but I didn't enough understood the parsing code to say that this is the true fix, so please do your analyze and own fix ;) Thanks for your help :) [1] http://www.faqs.org/rfcs/rfc822.html
I forgot the patch :(
--- Mail/Address.pm.orig 2008-06-17 00:19:05.000000000 +0200 +++ Mail/Address.pm 2008-06-17 00:19:33.000000000 +0200 @@ -156,7 +156,7 @@ if(substr($_,0,1) eq '(') { push @comment, $_ } elsif($_ eq '<') { $depth++ } elsif($_ eq '>') { $depth-- if $depth } - elsif($_ eq ',' || $_ eq ';') + elsif($_ eq ',') { warn "Unmatched '<>' in $line" if($depth); my $o = $class->_complete(\@phrase, \@address, \@comment); push @objs, $o if defined $o;
Subject: Re: [rt.cpan.org #36811] Mail::Address fail to parse rfc822 multiple mailboxes names
Date: Tue, 17 Jun 2008 08:36:11 +0200
To: Emmanuel Lacour via RT <bug-MailTools [...] rt.cpan.org>
From: Mark Overmeer <website [...] craneveer.nl>
* Emmanuel Lacour via RT (bug-MailTools@rt.cpan.org) [080616 22:23]: Show quoted text
> Mon Jun 16 18:23:13 2008: Request 36811 was acted upon. > Transaction: Ticket created by ELACOUR > Queue: MailTools > Subject: Mail::Address fail to parse rfc822 multiple mailboxes names > Broken in: 2.02, 2.03 > Severity: Important > Owner: Nobody > Requestors: ELACOUR@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36811 > > > > in rfc 822 [1], chapter 6.2.6, it is specified that an address can be a > "pseudo" group address like 'name:;'
An e-mail address can be much more difficult that what Mail::Address understands. I have made a full rfc implementation in Mail::Message::Field::Addresses, part of MailBox I do not think that your fix is correct: it returns the group name as if it is an address. To avoid the need to extend the interface of Mail::Address, I think that group names should get ignored. Could you try to improve your patch to do just like that. It may help: it is also not my code... I am you the patch-master. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Use Mail::Box if you want things to be done correctly. MailTools will never get these complex fixes (which need changes in the interface)