Skip Menu |

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

Report information
The Basics
Id: 58534
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: skangas [...] skangas.se
Cc:
AdminCc:

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



Subject: PATCH: Accept colons in maildir messages "unique name" part
Date: Sun, 20 Jun 2010 08:17:02 +0200
To: bug-Mail-Box [...] rt.cpan.org
From: Stefan Kangas <skangas [...] skangas.se>
The attached patch makes Mail::Box::Maildir::Message accept colons in maildir messages "unique name" part of the filename. The patch is against Mail-Box-2.094. Some background: In his write-up "Using maildir format", Dan Bernstein states that a unique name can be "anything that doesn't contain a colon". However, in the wild I encountered maildirs where this convention was not respected. Upon further research I learned that some MDA's apparently use extra comma delimited fields to hold various pieces of information. I found one description of this practice at the Dovecot wiki (see section "Maildir filename extensions"): http://wiki.dovecot.org/MailboxFormat/Maildir Mail::Box::Maildir::Message currently relies on the assumption that the unique name contains no colons. If there are any colons, we get errors: Use of uninitialized value $set in string ne at /home/skangas/src/Mail-Box-2.094/lib/Mail/Box/Maildir/Message.pm line 97. Use of uninitialized value $oldname in concatenation (.) or string at /home/skangas/src/Mail-Box-2.094/lib/Mail/Box/Maildir/Message.pm line 102. ERROR: Cannot rename Maildir/test/cur/1256749700.xxxxx.412.9118310093:2:2, to /cur/:2,: No such file or directory There may be good reasons for not accepting colons. I don't know of any such reasons, so in order to get my work done I decided to make this small change. Perhaps you will agree. Thanks, Stefan Kangas
--- Mail-Box-2.094/lib/Mail/Box/Maildir/Message.pm 2010-04-06 11:17:24.000000000 +0200 +++ Mail-Box-2.094p1/lib/Mail/Box/Maildir/Message.pm 2010-06-20 06:42:33.000000000 +0200 @@ -82,7 +82,7 @@ my $old = $self->filename; my ($folderdir, $set, $oldname) - = $old =~ m!(.*)/(new|cur|tmp)/([^:]*)(\:[^:]*)?$!; + = $old =~ m!(.*)/(new|cur|tmp)/(.+?)(\:2,[^:]*)?$!; my $newflags # alphabeticly ordered! = ($labels->{draft} ? 'D' : '')
Subject: Re: [rt.cpan.org #58534] PATCH: Accept colons in maildir messages "unique name" part
Date: Sun, 20 Jun 2010 21:06:59 +0200
To: Stefan Kangas via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Stefan Kangas via RT (bug-Mail-Box@rt.cpan.org) [100620 06:17]: Show quoted text
> Sun Jun 20 02:17:52 2010: Request 58534 was acted upon. > Subject: PATCH: Accept colons in maildir messages "unique name" part > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58534 > > > There may be good reasons for not accepting colons. I don't know of any > such reasons, so in order to get my work done I decided to make this > small change.
Who can ignore such a good study. Patch accepted. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
added to 2.095, to be released today