[imapfilter-devel]problem with sub-folders

Lefteris Chatzibarbas lefcha at hellug.gr
Sat Feb 1 21:24:01 EET 2003


On Fri, Jan 31, 2003 at 08:46:30PM +0100, Lederrey Guillaume wrote:
> [...]
> 
>   Now of course I have a problem : I'm using a folder hierarchy with
> sub-folders and I cant get imapfilter to send mail to sub-folders.  I
> dont know if it is a limitation of imapfilter or if I just dont
> understand how to do it ...  I'm using a courier-imap server.  Imap
> filter and the server are running on the same host (Debian Woody).

While defining folders or subfolders in imapfilter's config file, regardless
the format used for mail storage in the server (mbox, maildir, etc.), one
should still use the '/' character for delimiter and "" (ie. nothing) for
the prefix of mailboxes, _if_ the "namespace" option is enabled.  For
example a folder "INBOX.foo.bar" in maildir format should be defined
"foo/bar" in imapfilter's config file; imapfilter will inserts the "INBOX."
prefix and replace the '/' characters with the '.' delimiter.

When the "namespace" option is disabled one should define manually the
correct folder hierarchy, according to the namespace that is used by the
server.  So the aforementioned mailbox should be defined as "INBOX.foo.bar"
in imapfilter's config file.

Actually, it's a bug of the documentation of imapfilter that this explanation
isn't included in its manual pages...


BTW, if you and anyone else is having problems with rcopy/rmove to maildir
format mail servers (such as courier-imap) while having enabled the
"namespace" option, he/she should apply the attached patch to v0.8.4
(possibly a v0.8.5 release will follow).

-------------- next part --------------
diff -ruN imapfilter-0.8.4.orig/request.c imapfilter-0.8.4/request.c
--- imapfilter-0.8.4.orig/request.c	2003-02-01 20:59:17.000000000 +0200
+++ imapfilter-0.8.4/request.c	2003-02-01 20:59:48.000000000 +0200
@@ -537,7 +537,7 @@
     /* apply_namespace() returns a pointer to a static buffer. */
     ndm = apply_namespace(destmbox, nspaux.prefix, nspaux.delim);
 
-    r = check_mailbox(&sockaux, ndm, &nspaux);
+    r = check_mailbox(&sockaux, destmbox, &nspaux);
 
     if (r == RESPONSE_OK)
 	close_mailbox(&sockaux);


More information about the Imapfilter-devel mailing list