isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 9eaa97923aebfa2b0f46b8ba2c66856ef61972bd
parent 2d1cfc2c7f7262d578b4e52b904c9e471937e2a4
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Tue, 21 Mar 2017 14:39:07 +0100

fix exclusion of bogus "INBOX.*" folders in Maildir++

this also adds code which avoids that the message about excluding the
mailbox is printed multiple times - this could happen with Maildir++, as
the hierarchy is flattened.

amends 0f24ca31b.

Diffstat:
Msrc/drv_maildir.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c @@ -303,6 +303,7 @@ maildir_list_recurse( store_t *gctx, int isBox, int flags, DIR *dir; int style = ((maildir_store_conf_t *)gctx->conf)->sub_style; int pl, nl, i; + int warned = 0; struct dirent *de; struct stat st; @@ -370,9 +371,12 @@ maildir_list_recurse( store_t *gctx, int isBox, int flags, name[i] = '/'; } } - if (nameLen == nameOff && equals( effName, nl - nameOff, "INBOX", 5 ) && (!effName[5] || effName[5] == '/')) { - path[pathLen] = 0; - warn( "Maildir warning: ignoring INBOX in %s\n", path ); + if (nameLen == nameOff && starts_with( effName, nl - nameOff, "INBOX", 5 ) && (!effName[5] || effName[5] == '/')) { + if (!warned) { + warned = 1; + path[pathLen] = 0; + warn( "Maildir warning: ignoring INBOX in %s\n", path ); + } continue; } path[pl++] = '/';