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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 951
Download (untitled) / with headers
text/plain 951b
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Message-Id: <rt-3.6.HEAD-12137-1213655106-1270.36811-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1213655106-12137-1"
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 21
I forgot the patch :(
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: multipart/mixed; boundary="----------=_1213655106-12137-0"
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-diff; name="Address.diff"
Content-Disposition: inline; filename="Address.diff"
Content-Transfer-Encoding: binary
Content-Length: 524
Download Address.diff
text/x-diff 524b
--- 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;
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.6.HEAD-12165-1213654994-853.36811-4-0 [...] rt.cpan.org>
Content-Disposition: inline
References: <RT-Ticket-36811 [...] rt.cpan.org> <rt-3.6.HEAD-12165-1213654994-853.36811-4-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 0EC434D80A1 for <bug-MailTools [...] rt.cpan.org>; Tue, 17 Jun 2008 02:36:19 -0400 (EDT)
Received: (qmail 31396 invoked from network); 17 Jun 2008 06:36:19 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 Jun 2008 06:36:19 -0000
Received: from mail.overmeer.net (HELO earth.overmeer.net) (194.109.195.227) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jun 2008 23:36:15 -0700
Received: by earth.overmeer.net (Postfix, from userid 500) id 6F6EBAC46C; Tue, 17 Jun 2008 08:36:11 +0200 (CEST)
Delivered-To: cpan-bug+MailTools [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #36811] Mail::Address fail to parse rfc822 multiple mailboxes names
User-Agent: Mutt/1.5.9i
Return-Path: <markov [...] overmeer.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-MailTools [...] rt.cpan.org
Date: Tue, 17 Jun 2008 08:36:11 +0200
X-Spam-Level: *
Message-Id: <20080617063611.GA30837 [...] earth.overmeer.net>
To: Emmanuel Lacour via RT <bug-MailTools [...] rt.cpan.org>
From: Mark Overmeer <website [...] craneveer.nl>
RT-Message-ID: <rt-3.6.HEAD-2064-1213984119-961.36811-0-0 [...] rt.cpan.org>
Content-Length: 1414
Download (untitled) / with headers
text/plain 1.3k
* 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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-12431-1220342953-989.36811-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 138
Download (untitled) / with headers
text/plain 138b
Use Mail::Box if you want things to be done correctly. MailTools will never get these complex fixes (which need changes in the interface)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.