bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] [PATCH] maildir: Keep trailing comma even when no flags


From: Damien Diederen
Subject: [bug-mailutils] [PATCH] maildir: Keep trailing comma even when no flags are set
Date: Tue, 10 Jun 2014 11:38:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi,

Attached is a tiny patch for a bad interaction between Mailutil and
Gnus when using Maildirs.

Without this patch, Mailutils's `mk_info_filename' generates filenames
of the following form when the flag set is empty:

    1402217787.M664911P5957Q143.hostname:2

The original Maildir spec (http://cr.yp.to/proto/maildir.html), however,
mandates that filenames must be of the form `uniq:info', with `info'
starting with "2,"--including a comma.

This patch removes the "cleanup" performed by `mk_info_filename' as that
there is no rationale for it in mailutils' source code history, and as
it breaks Gnus' "nnmaildir" backend (Cf.  `nnmaildir--add-flag').

Best regards,
Damien Diederen

P.-S. — I assume you don't need paperwork for such a trivial patch.
>From 5e852f31736c5ea32fab90a341a2008ddf7aa199 Mon Sep 17 00:00:00 2001
From: Damien Diederen <address@hidden>
Date: Sun, 8 Jun 2014 11:32:15 +0200
Subject: [PATCH] maildir: Keep trailing comma even when no flags are set
To: address@hidden

Without this, `mk_info_filename' generates filenames of the following
form when the flag set is empty:

    1402217787.M664911P5957Q143.hostname:2

The original Maildir spec (http://cr.yp.to/proto/maildir.html),
however, mandates that filenames must be of the form `uniq:info', with
`info' starting with "2,"--including a comma.

This patch removes the "cleanup" performed by `mk_info_filename' as
that there is no rationale for it in mailutils' source code history,
and as it breaks Gnus' "nnmaildir" backend (Cf.  `nnmaildir--add-flag').

* libproto/maildir/mbox.c (mk_info_filename): Keep comma at the end of
filename when the flags suffix is empty.
---
 libproto/maildir/mbox.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libproto/maildir/mbox.c b/libproto/maildir/mbox.c
index 3cddb6f..9773143 100644
--- a/libproto/maildir/mbox.c
+++ b/libproto/maildir/mbox.c
@@ -278,10 +278,7 @@ mk_info_filename (char *directory, char *suffix, char 
*name, int flags)
   size += 3 + strlen (fbuf);
 
   tmp = malloc (size);
-  if (!fbuf[0])
-    sprintf (tmp, "%s/%s/%*.*s:2", directory, suffix, namelen, namelen, name);
-  else
-    sprintf (tmp, "%s/%s/%*.*s:2,%s", directory, suffix, namelen, namelen, 
name, fbuf);
+  sprintf (tmp, "%s/%s/%*.*s:2,%s", directory, suffix, namelen, namelen, name, 
fbuf);
   return tmp;
 }
 
-- 
2.0.0

-- 
http://crosstwine.com
tel:  +49 89 2189 2939
cell: +49 174 3489 428

“Strong Opinions, Weakly Held”
                 — Bob Johansen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]