Skip Menu |

This queue is for tickets about the MIME-tools CPAN distribution.

Report information
The Basics
Id: 65681
Status: resolved
Priority: 0/
Queue: MIME-tools

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc: jcrotty_alpine [...] hotmail.com
AdminCc:

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



Subject: carriage returns now appear where they did not before
I received this bug report about Email::Abstract: https://rt.cpan.org/Ticket/Display.html?id=64946 It looks like header values as of 5.500 (for my tests) now come back with trailing \r, where they previously came back entirely trailing-CRLF-stripped Do you agree that this is a MIME::Entity digression? -- rjbs
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Sat, 12 Feb 2011 15:27:13 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Sat, 12 Feb 2011 15:01:45 -0500 "Ricardo Signes via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> It looks like header values as of 5.500 (for my tests) now come back > with trailing \r, where they previously came back entirely > trailing-CRLF-stripped
Show quoted text
> Do you agree that this is a MIME::Entity digression?
That's entirely possible... but unfortunately, I can't follow your test code. Would it be possible for you to create a simple test case against MIME::tools (only)? Regards, David.
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Sat, 12 Feb 2011 16:27:03 -0500
To: "David F. Skoll via RT" <bug-MIME-tools [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* "David F. Skoll via RT" <bug-MIME-tools@rt.cpan.org> [2011-02-12T15:27:38] Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=65681 > > > On Sat, 12 Feb 2011 15:01:45 -0500 > "Ricardo Signes via RT" <bug-MIME-tools@rt.cpan.org> wrote: >
> > It looks like header values as of 5.500 (for my tests) now come back > > with trailing \r, where they previously came back entirely > > trailing-CRLF-stripped
>
> > Do you agree that this is a MIME::Entity digression?
> > That's entirely possible... but unfortunately, I can't follow your > test code. > > Would it be possible for you to create a simple test case against > MIME::tools (only)?
Sure thing, I'll have a go at doing that in the next day or two. -- rjbs
From: jcrotty_alpine [...] hotmail.com
On Sat Feb 12 15:27:37 2011, dfs@roaringpenguin.com wrote: Show quoted text
> On Sat, 12 Feb 2011 15:01:45 -0500 > "Ricardo Signes via RT" <bug-MIME-tools@rt.cpan.org> wrote: >
> > It looks like header values as of 5.500 (for my tests) now come back > > with trailing \r, where they previously came back entirely > > trailing-CRLF-stripped
>
> > Do you agree that this is a MIME::Entity digression?
> > That's entirely possible... but unfortunately, I can't follow your > test code. > > Would it be possible for you to create a simple test case against > MIME::tools (only)? > > Regards, > > David. >
David, I work at a high volume email shop and we're having the same problem with LF showing up in header properties. Simple test case code attached. Put 1297878396953-517.para in /tmp and run the script. After a few runs uncomment line 27 and redirect output to a file. Open an editor on the file and you can see the headers all have LF as part of their actual values.
Subject: 1297878396953-517.para
Download 1297878396953-517.para
application/octet-stream 5.7k

Message body not shown because it is not plain text.

Subject: mimetools_eol_problem.pl
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use MIME::Parser 5.426; my $msg = '/tmp/1297878396953-517.para'; my $parser = new MIME::Parser; $parser->output_under("/tmp"); my $entity; eval { $entity = $parser->parse_open($msg); }; if ($@) { print Dumper('Kaboom'); exit; } elsif ($parser->last_error) { print Dumper($parser->last_error); } #$entity->dump_skeleton; #print Dumper($entity); my $header = $entity->head(); my $ip = $header->get("x-rp-sendingip"); #chomp($ip); #$ip =~ s/(\r|\n)//g; $ip =~ s/\r/CR/g; $ip =~ s/\n/LF/g; print Dumper($ip);
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Thu, 17 Feb 2011 10:46:01 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Thu, 17 Feb 2011 10:37:43 -0500 "Joseph Crotty via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> I work at a high volume email shop and we're having the same problem > with LF showing up in header properties. Simple test case code > attached. Put 1297878396953-517.para in /tmp and run the script. > After a few runs uncomment line 27 and redirect output to a file. > Open an editor on the file and you can see the headers all have LF as > part of their actual values.
Right, I seem some differences. I modified your code to print the MIME::Tools version number and here's what I get: $ perl mimetools_eol_problem.pl MIME::Tools version is 5.420 $VAR1 = '173.205.163.48LF'; $ perl -I/home/dfs/Software/MIME-tools.git/lib mimetools_eol_problem.pl MIME::Tools version is 5.500 $VAR1 = '173.205.163.48CRLF'; I will investigate. Regards, David.
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Thu, 17 Feb 2011 12:02:22 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Ricardo and Joseph, Please try: http://www.roaringpenguin.com/MIME-tools-5.501.tar.gz Signature: http://www.roaringpenguin.com/MIME-tools-5.501.tar.gz.sig My public key: http://www.roaringpenguin.com/files/dskoll-key-2005.txt Please DO NOT distribute this because it isn't yet the "official" 5.501 release. Regards, David. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFNXVSewYQuKhJvQuARAme7AJ0dgK2FVGEbRxAth+tNfuuDAWYEJwCdEbeY m0qmRur7SaCH/Bq9c2rJlN0= =6qRL -----END PGP SIGNATURE-----
CC: jcrotty_alpine [...] hotmail.com
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Thu, 17 Feb 2011 12:08:23 -0500
To: "David F. Skoll via RT" <bug-MIME-tools [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* "David F. Skoll via RT" <bug-MIME-tools@rt.cpan.org> [2011-02-17T12:02:37] Show quoted text
Sorry I couldn't get you the simplified test case sooner -- but I'm glad somebody else beat me to it. I just tested Email::Abstract (with its regression tests) with that tarball installed, and all tests passed. I have not dug any deeper than that, but it looks good to me. -- rjbs
From: jcrotty_alpine [...] hotmail.com
On Thu Feb 17 12:02:37 2011, dfs@roaringpenguin.com wrote: Show quoted text
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, Ricardo and Joseph, > > Please try: > > http://www.roaringpenguin.com/MIME-tools-5.501.tar.gz > Signature: http://www.roaringpenguin.com/MIME-tools-5.501.tar.gz.sig > > My public key: http://www.roaringpenguin.com/files/dskoll-key-2005.txt > > Please DO NOT distribute this because it isn't yet the "official" > 5.501 release. > > Regards, > > David. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iD8DBQFNXVSewYQuKhJvQuARAme7AJ0dgK2FVGEbRxAth+tNfuuDAWYEJwCdEbeY > m0qmRur7SaCH/Bq9c2rJlN0= > =6qRL > -----END PGP SIGNATURE-----
David, My test still shows the LF char use MIME::Parser 5.501 $VAR1 = '173.205.163.48LF'; Joe
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Thu, 17 Feb 2011 12:54:33 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Thu, 17 Feb 2011 12:49:45 -0500 "Joseph Crotty via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> My test still shows the LF char use MIME::Parser 5.501
Yes, but MIME::Parser 5.428 worked the same way. I'm trying to keep the behaviour the same as earlier versions. Regards, David.
From: jcrotty_alpine [...] hotmail.com
On Thu Feb 17 12:54:43 2011, dfs@roaringpenguin.com wrote: Show quoted text
> On Thu, 17 Feb 2011 12:49:45 -0500 > "Joseph Crotty via RT" <bug-MIME-tools@rt.cpan.org> wrote: >
> > My test still shows the LF char use MIME::Parser 5.501
> > Yes, but MIME::Parser 5.428 worked the same way. I'm trying > to keep the behaviour the same as earlier versions. > > Regards, > > David.
David, Understood. I was under the impression that our prd install of 5.426 didn't produce the LF, but after a test run it does as well. So, your answer makes perfect sense. Thanks for fixing. Another bug that became a feature, but that's a small price. I can hardly imagine someone is making us of the header LF "feature", but would not be surprised.
Subject: Re: [rt.cpan.org #65681] carriage returns now appear where they did not before
Date: Thu, 17 Feb 2011 13:25:45 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Thu, 17 Feb 2011 13:22:50 -0500 "Joseph Crotty via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> Understood. I was under the impression that our prd install of 5.426 > didn't produce the LF, but after a test run it does as well. So, your > answer makes perfect sense. Thanks for fixing. Another bug that > became a feature, but that's a small price. I can hardly imagine > someone is making us of the header LF "feature", but would not be > surprised.
Well, *I* think it's definitely a bug, but at the same time, I am very leery of changing long-established behaviour. I have no idea what else might break. :( I will document the fact that grabbing MIME headers may return newlines, which should be chomp()'d off if you don't want them. Regards, David.
Hello, I believe the just-released 5.501 version of MIME::tools fixes this bug. Regards, David.