On Fri, 2008-02-29 at 12:19 -0500, Paul Letta wrote:

> Since I can't get a hold of my users and make them all put their imap
> folders in /home/username/mail and configure dovecot to just search
> there...

Couldn't you do this automatically? Move all files that look like mboxes
to mail/ directory.

> Is there a way to tell dovecot to ignore links ?

Attached a patch, but I don't really like the idea of adding a setting
for it. It could give a false sense of security since it only changes
mailbox listing, the symlinks are still followed if the mailboxes are
selected.
diff -r eb249c6e4fef src/lib-storage/index/mbox/mbox-list.c
--- a/src/lib-storage/index/mbox/mbox-list.c	Fri Feb 29 11:18:02 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-list.c	Fri Feb 29 20:17:09 2008 +0200
@@ -246,7 +246,7 @@ static int list_file(struct mbox_list_co
 
 	/* see if it's a directory */
 	real_path = t_strconcat(ctx->dir->real_path, "/", fname, NULL);
-	if (stat(real_path, &st) == 0)
+	if (lstat(real_path, &st) == 0)
 		noselect = FALSE;
 	else if (errno == EACCES || errno == ELOOP)
 		noselect = TRUE;
@@ -295,7 +295,7 @@ static int list_file(struct mbox_list_co
 		} else if (ret < 0)
 			return -1;
 		return match > 0 || match2 > 0;
-	} else if (match > 0) {
+	} else if (match > 0 && !S_ISLNK(st.st_mode)) {
 		ctx->list.flags = noselect ? MAILBOX_NOSELECT :
 			(MAILBOX_NOINFERIORS | STAT_GET_MARKED(st));
 		ctx->list.name = p_strdup(ctx->list_pool, list_path);

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to