Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 128174
Status: open
Priority: 0/
Queue: Mail-Box

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

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



Subject: Mail::Box::Mbox folds empty lines at the beginning (and end) of a message body.
$ perl -MMail::Box::Mbox -E 'say Mail::Box::Mbox->VERSION' 3.005 $ diff mbox <(perl -MMail::Box::Mbox -E 'Mail::Box::Mbox->new(folder=>shift)->[0]->print' mbox) 1d0 < From postmaster@mensa.de Sun Jan 06 01:35:52 2019 24d22 < 38d35 < Unfortunately, this invalidates the DKIM signature: $ <mbox perl -MMail::DKIM::Verifier -E '$dkim=Mail::DKIM::Verifier->new;while(<>){chomp;$dkim->PRINT("$_\cM\cJ")}$dkim->CLOSE;say$dkim->result' pass $ perl -MMail::Box::Mbox -E 'Mail::Box::Mbox->new(folder=>shift)->[0]->print' mbox|perl -MMail::DKIM::Verifier -E '$dkim=Mail::DKIM::Verifier->new;while(<>){chomp;$dkim->PRINT("$_\cM\cJ")}$dkim->CLOSE;say$dkim->result' fail Please find a sample mbox file to reproduce this attached. Regards fany
Subject: mbox
Download mbox
application/octet-stream 1.8k

Message body not shown because it is not plain text.

CC: ;
Subject: Re: [rt.cpan.org #128174] Mail::Box::Mbox folds empty lines at the beginning (and end) of a message body.
Date: Wed, 9 Jan 2019 12:07:27 +0100
To: FANY via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* FANY via RT (bug-Mail-Box@rt.cpan.org) [190106 00:48]: Show quoted text
> Subject: Mail::Box::Mbox folds empty lines at the beginning (and end) of a > message body. > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=128174 >
Show quoted text
> Unfortunately, this invalidates the DKIM signature:
Oops. In earlier days, emails were generated very sloppy, so people where happy when superfluous blank lines got removed. Nowadays, that is not acceptable... I agree. This must be fixed. Show quoted text
> $ perl -MMail::Box::Mbox -E 'Mail::Box::Mbox->new(folder=>shift)->[0]->print' mbox
This is not 100% correct. Either you have an email message, which can be read as my $fromline = <>; my $msg = Mail::Message->read(\*STDIN); $msg->print; Or you have an mbox with messages (the subtile difference is the (de)escaping of content lines starting with 'From' into '>From'). In that case, you should use: my $msg = Mail::Message->coerce($folder->message(0)); $msg->print; coerce() converts a Mail::Box::Mbox::Message into a simple Mail::Message I stumbled on an other buglet of MailBox with your script: please open the folder with extract => 'ALWAYS'. I need more time to hunt-down these issues. Thanks for reporting -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net