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 <[email protected]>
Date: Sun, 8 Jun 2014 11:32:15 +0200
Subject: [PATCH] maildir: Keep trailing comma even when no flags are set
To: [email protected]

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
_______________________________________________
Bug-mailutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-mailutils

Reply via email to