Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Simple CPAN distribution.

Report information
The Basics
Id: 26032
Status: resolved
Priority: 0/
Queue: Email-Simple

People
Owner: Nobody in particular
Requestors: kernel [...] pkts.ca
Cc:
AdminCc:

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



Subject: Bug in header parsing in Email::Simple
Date: Sun, 01 Apr 2007 14:52:29 -0700
To: bug-Email-Simple [...] rt.cpan.org
From: PF <kernel [...] pkts.ca>
Hello! I'm using Email::Simple and exploring the features. Today I was reading the headers of email messages, and found that the first line of the headers, the "From emailaddress date" line, is mangled. This happens because the header-splitting algorithm splits all header lines on the first colon (':'). This results in splitting like this: my @header=$email->header_pairs; $header[0]="From user@address.com Sun Apr 1 13"; $header[1]="49:01 2007"; It's not the world's most important header, which is probably why this hasn't been discovered before. Thanks for a very useful program! --- Be sure to include at least the following information: * Distribution name and version (For example, "DBIx-SearchBuilder-0.46") perl-Email-Simple-1.998-1.noarch.rpm * Perl version (Find this by running the command perl -v) perl v5.8.5 * Operating System vendor and version (Find this by running the command uname -a) Fedora Core 3 Other things that are often helpful: * Details about your operating environment that might be related to the issue being described The sample program is being given an email message as standard input. * Exact cut and pasted error or warning messages No error message * The shortest, clearest code you can manage to write which reproduces the bug described. --- #!/usr/bin/perl -w use strict; use Email::Simple; { local ($/); $msg=<>; } my $email=Email::Simple->new($msg); my @headers=$email->header_pairs; for (my $x=0;$x<@headers;$x+=2) { print $headers[$x]." -- ".$headers[$x+1]."\n"; } --- * A patch against the latest released version of this distribution which fixes this bug. Sorry. -- PF <kernel@pkts.ca>
The "From" line is part of the mbox spec, and is not part of the message. This is not a bug in Email::Simple. This should be made available by whatever is reading your Mbox for you. -- rjbs
Subject: Re: [rt.cpan.org #26032] Bug in header parsing in Email::Simple
Date: Sun, 01 Apr 2007 22:22:27 -0700
To: bug-Email-Simple [...] rt.cpan.org
From: PF <kernel [...] pkts.ca>
On Sun, 2007-04-01 at 19:33 -0400, Ricardo Signes via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26032 > > > The "From" line is part of the mbox spec, and is not part of the > message. This is not a bug in Email::Simple. This should be made > available by whatever is reading your Mbox for you.
Actually, my program is being called by sendmail from /etc/aliases; no mailbox is involved. But that's good to know, and it's easy for me to strip myself. Thanks! -- PF <kernel@pkts.ca>
(This bug was mistakenly re-opened on reply.) -- rjbs