[Dovecot] being courier_imap compatible
Bill Boebel
bill at webmail.us
Thu Apr 27 01:19:37 EEST 2006
On Wed, April 26, 2006 16:12, "Chad Leigh -- Shire.Net LLC" <chad at shire.net> said:
> OK, I am running (for many years now) an existing courier_imap maildir++
> setup with exim as the MTA.
> I set up a namespace for dovecot, using the wiki as a guide, so:
>
> namespace private {
> separator = .
> prefix = INBOX.
> location = .
> inbox = yes
> hidden=no
> }
>
> However, clicking on the folder does not show any messages at all.
> dovecot is not creating a subscription file inside the maildir
> (Mail.app does not allow you to subscribe to folders -- it subscribes
> to all existing folders for you)
>
> And if I try and create a new folder inside the account I get a
> "CREATE" command failed, server error: unknown namespace
This is what we're using and our Courier maildirs are able to work with Dovecot...
default_mail_env = maildir:~/
namespace private {
separator = .
prefix = INBOX.
inbox = no
}
namespace private {
separator = .
prefix =
inbox = yes
hidden = yes
}
Also, here are patches to make Dovecot use Courier's subscription file properly...
---
src/lib-storage/index/maildir/maildir-storage.h:
-#define SUBSCRIPTION_FILE_NAME "subscriptions"
+#define SUBSCRIPTION_FILE_NAME "courierimapsubscribed"
---
src/lib-storage/subscription-file/subscription-file.c
@49
unsigned int i; // BB - added variable
@55
/* BB - changed loop to skip over lines with just
INBOX and remove INBOX. from the beginning of the line,
for courier-imap compatibility */
for (i = 0;; i++) {
while ((line = i_stream_next_line(input)) == NULL) {
switch (i_stream_read(input)) {
case -1:
if (input->stream_errno != 0 &&
(input->stream_errno != ESTALE || !ignore_estale)) {
subsfile_set_syscall_error(storage,
"read()", path);
*failed_r = TRUE;
}
return NULL;
case -2:
/* mailbox name too large */
mail_storage_set_critical(storage,
"Subscription file %s contains lines longer "
"than %u characters", path,
MAX_MAILBOX_LENGTH);
*failed_r = TRUE;
return NULL;
}
}
/* BB - remove INBOX. from the beginning of the line,
for courier-imap compatibility */
if (strcmp(line, "INBOX") == 0)
continue;
if (strncmp(line, "INBOX.", 6) == 0)
line += 6;
break;
}
/* BB - end changes */
@147
/* BB - prepend INBOX. for courier-imap compatibility */
-if (o_stream_send_str(output, line) < 0 ||
+if (o_stream_send_str(output, "INBOX.") < 0 ||
+ o_stream_send_str(output, line) < 0 ||
@150
-line = t_strconcat(name, "\n", NULL);
+/* BB - prepend INBOX. for courier-imap compatibility */
+line = t_strconcat("INBOX.", name, "\n", NULL);
More information about the dovecot
mailing list