Subject: | PATCH: Do not unnecessarily add info field to mail in maildir `new' directory |
Date: | Mon, 21 Jun 2010 07:20:12 +0200 |
To: | bug-Mail-Box [...] rt.cpan.org |
From: | Stefan Kangas <skangas [...] skangas.se> |
In his write-up "Using maildir format", Daniel Bernstein states:
,----
| When you move a file from new to cur, you have to change its name from
| uniq to uniq:info. Make sure to preserve the uniq string, so that
| separate messages can't bump into each other.
`----
Mail::Box::Maildir::Message currently appends an info field (":2,") to
all maildir messages, even if they are still inside the "new" directory.
Alas, some other software (notably Gnus) relies on the assumption that
there is no info field until the message is moved into the "cur"
directory, and naively adds another info field without checking for an
old one. The result is duplicate info fields.
Mutt, on the other hand, seems to have taken the middle ground, adding
an info field to messages inside "new" only when there are any flags. I
believe this to be a conservative approach that wins on two accounts: it
never loses any information, yet for the most part plays nice with
other, perhaps not as cautious software.
I suggest Mail::Box::Maildir::Message should do like Mutt, and the
attached patch does this change. The relevant test has also been
updated.
Thanks,
Stefan Kangas