I agree with your suggestion that watch_maildirs should not error on such
directories. And in fact, this is what it is supposed to do.
(Except that it actually watches the dir to see if it later becomes a maildir.)

The assert occured because watch_maildirs sees a folder named ".INBOX",
which would have the imap name "INBOX", and then detects a name collision
with "~/Maildir/" which also has the imap name "INBOX".

The attached patch should correct this problem; it changes watch_maildirs
to ignore any subdirectory named ".INBOX". Can you double check that
this works correctly?


On Sun, Aug 06, 2006 at 11:03:51PM +0200, Tino Keitel wrote:
> I ran into the following problem:
> 
> It looks like watch_maildirs doesn't like my dovecot style maildirs on
> the IMAP server. The layout is like this:
> 
> - ~/Maildir/(cur|new|tmp) acts as INBOX
> 
> - ~/Maildir/.foo/(cur|new|tmp) acts as folder foo
> 
> - there is a ~/Maildir/.INBOX directory that is used by dovecot only to
>   store metadata, but it looks like watch_maildirs expects this to be a
>   maildir that contains new, cur and tmp. But is doesn't, and it throws
>   an assertion failure:
> 
> [pid 22484] stat64("/home/scorpi/Maildir/.INBOX/cur/", 0xbffff87c) =
> -1 ENOENT (No such file or directory)
> 
> watch_maildirs: state.cc:39: void dnotify_state::add_imap_watcher(int,
> const std::string&, watcher*): Assertion xisting_imap == w' failed.
> 
> Maybe watch_maildirs should just ignore directories without cur, new
> and tmp instead of fail with an error.

-- 
Chris Frost  |  <http://www.frostnet.net/chris/>
-------------+----------------------------------
Public PGP Key:
   Email [EMAIL PROTECTED] with the subject "retrieve pgp key"
   or visit <http://www.frostnet.net/chris/about/pgp_key.phtml>
Index: src/watch_maildirs/watch_maildirs.h
===================================================================
--- src/watch_maildirs/watch_maildirs.h (revision 250)
+++ src/watch_maildirs/watch_maildirs.h (working copy)
@@ -68,6 +68,11 @@
                        continue;
                if (!strcmp(ep->d_name, ".") || !strcmp(ep->d_name, ".."))
                        continue;
+               // Ignore dovecot's '.INBOX/' used for metadata, not mail.
+               // Ok for non-dovecot stores since this is not a legal mailbox 
name
+               // as its imap name conflicts with the base maildir's imap name.
+               if (!strcmp(ep->d_name, ".INBOX"))
+                       continue;
 
                if (is_maildir(mkfilename(base, ep->d_name)))
                        ++*maildirs = ep->d_name;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to