Discussion:
[Dovecot] getting Apple Mail and dovecot/IMAP to co-operate
Jim Reid
2009-07-08 16:58:53 UTC
Permalink
Hi. I've been fighting a losing battle to get Apple Mail and dovecot
to play nice. When dovecot is told to use mbox-style mailboxes, it's
not possible to create child mailboxes. Apple Mail whines "The IMAP
command ?CREATE? failed with server error: Mailbox doesn't allow
inferior mailboxes.". I've looked through the documentation, the wiki
and searched the mail archives without finding a solution. Can anyone
help?

I've tried (and failed) to get a hybrid maildir/mbox setup to work
like that shown on http://wiki.dovecot.org/Namespaces. When that gets
plugged into dovecot.conf, Apple Mail blocks, with the Activity window
saying "waiting for login" or something like that, even though a valid
imaps connection and login has been established.

There's nothing getting logged by dovecote for both of these problems,
even when syslog is turned all the way to debug priority.

Here's the current configuration info:

shaun# dovecot -n
# 1.1.16: /usr/local/etc/dovecot.conf
# OS: FreeBSD 7.2-RELEASE amd64 ufs
base_dir: /var/run/dovecot/
syslog_facility: local4
protocols: imaps
listen: *, [::]
ssl_cert_file: /usr/local/etc/ssl/certs/dovecot.pem
ssl_key_file: /usr/local/etc/ssl/private/dovecot.pem
ssl_cipher_list: ALL:!LOW:!SSLv2
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
login_max_processes_count: 8
login_max_connections: 32
max_mail_processes: 32
mail_privileged_group: mail
mail_location: mbox:/mail/imap/%u:INBOX=/var/mail/%u
mail_debug: yes
mbox_write_locks: fcntl
auth default:
mechanisms: cram-md5
verbose: yes
debug: yes
passdb:
driver: pam
passdb:
driver: passwd-file
args: /usr/local/etc/dovecot-md5
userdb:
driver: passwd
shaun# dovecot --version
1.1.16
Timo Sirainen
2009-07-08 17:08:54 UTC
Permalink
Post by Jim Reid
Hi. I've been fighting a losing battle to get Apple Mail and dovecot
to play nice. When dovecot is told to use mbox-style mailboxes, it's
not possible to create child mailboxes. Apple Mail whines "The IMAP
command ?CREATE? failed with server error: Mailbox doesn't allow
inferior mailboxes.". I've looked through the documentation, the wiki
and searched the mail archives without finding a solution. Can anyone
help?
If you want to create e.g. "sub/box", start from nothing. Don't create
"sub". Give the mailbox name as "sub/box". The "sub" then can't have
messages, but it can have other child mailboxes.
Post by Jim Reid
I've tried (and failed) to get a hybrid maildir/mbox setup to work
like that shown on http://wiki.dovecot.org/Namespaces. When that gets
plugged into dovecot.conf, Apple Mail blocks, with the Activity window
saying "waiting for login" or something like that, even though a valid
imaps connection and login has been established.
I don't really know about that. What kind of a namespace configuration
exactly did you use?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090708/c0411212/attachment.bin
Jim Reid
2009-07-08 17:33:42 UTC
Permalink
Post by Timo Sirainen
Post by Jim Reid
Hi. I've been fighting a losing battle to get Apple Mail and dovecot
to play nice. When dovecot is told to use mbox-style mailboxes, it's
not possible to create child mailboxes. Apple Mail whines "The IMAP
command ?CREATE? failed with server error: Mailbox doesn't allow
inferior mailboxes.". I've looked through the documentation, the wiki
and searched the mail archives without finding a solution. Can anyone
help?
If you want to create e.g. "sub/box", start from nothing. Don't create
"sub". Give the mailbox name as "sub/box". The "sub" then can't have
messages, but it can have other child mailboxes.
Thanks for the quick response Timo. Sadly, your suggestion doesn't
look as if it'll work because there are many non-empty parent
mailboxes that have to get shifted to the new dovecot server. ie There
are messages in sub as well as sub/box: too many to move to sub/
whatever. And there are many of these sorts of folders too. Some
mailboxes are even more deeply nested with subfolders: sub/box1/box2
where sub/box1 holds messages. Looks like an all-mbox solution isn't
going to be viable at all. Oh well.
Post by Timo Sirainen
Post by Jim Reid
I've tried (and failed) to get a hybrid maildir/mbox setup to work
like that shown on http://wiki.dovecot.org/Namespaces. When that gets
plugged into dovecot.conf, Apple Mail blocks, with the Activity window
saying "waiting for login" or something like that, even though a valid
imaps connection and login has been established.
I don't really know about that. What kind of a namespace configuration
exactly did you use?
Here's the last one I tried before hitting a dead end. There were
various combinations of settings for the prefix, hidden and list
variables that were tried unsuccessfully before that.

###namespace private {
### separator = /
### #prefix = "#mbox/"
### location = mbox:INBOX=/var/mail/%u
### inbox = yes
### #hidden = yes
### list = no # for v1.1+
###}
###namespace private {
### separator = /
### prefix =
### location = maildir:/mail/imap/$u:LAYOUT=fs
### inbox = no
### list = yes
###}
Timo Sirainen
2009-07-08 17:38:22 UTC
Permalink
Post by Jim Reid
Thanks for the quick response Timo. Sadly, your suggestion doesn't
look as if it'll work because there are many non-empty parent
mailboxes that have to get shifted to the new dovecot server. ie There
are messages in sub as well as sub/box: too many to move to sub/
whatever. And there are many of these sorts of folders too. Some
mailboxes are even more deeply nested with subfolders: sub/box1/box2
where sub/box1 holds messages. Looks like an all-mbox solution isn't
going to be viable at all. Oh well.
Right, in that case you can't use FS layout. But you could use e.g.
Maildir++ layout:

mail_location = mbox:~/mail:LAYOUT=maildir++

Then the mailboxes get created like:

~/mail/.sub
~/mail/.sub.box
Post by Jim Reid
Post by Timo Sirainen
I don't really know about that. What kind of a namespace configuration
exactly did you use?
Here's the last one I tried before hitting a dead end. There were
various combinations of settings for the prefix, hidden and list
variables that were tried unsuccessfully before that.
###namespace private {
### separator = /
### #prefix = "#mbox/"
### location = mbox:INBOX=/var/mail/%u
This is a broken location setting. It's missing the mbox root directory.
Post by Jim Reid
### inbox = yes
### #hidden = yes
### list = no # for v1.1+
###}
It should be list=yes, otherwise mailboxes aren't visible to client.
Probably hidden=yes too so it won't confuse other clients.
Post by Jim Reid
###namespace private {
### separator = /
### prefix =
Two namespaces can't have the same prefix. You commented out in the
first one, so that doesn't work. If you wanted Dovecot to somehow
automatically figure out what mailboxes are maildir and what are mboxes,
that's not possible yet.
Post by Jim Reid
### location = maildir:/mail/imap/$u:LAYOUT=fs
There's no such thing as $u. I guess meant %u.
Post by Jim Reid
### inbox = no
### list = yes
###}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090708/e0a795cf/attachment.bin
Jim Reid
2009-07-13 11:53:26 UTC
Permalink
Hi Timo. Thanks again for your help. I've got things just about
working as planned. There's one minor irritation however. Users see a
strange mailbox icon at the top of their list of mailboxes on the
dovecot server. It's called #mbox and has a > symbol next to it
indicating that it contains nested mailbox(es). The icon for the
mailbox not filled in, which is usually how Apple Mail indicates
there's something wrong with the mailbox. In this case, it's not
possible to put messages in #mbox. Is there a simple way to make this
mailbox disappear from the list displayed by the client?

# 1.1.16: /usr/local/etc/dovecot.conf
# OS: FreeBSD 7.2-RELEASE amd64
base_dir: /var/run/dovecot/
syslog_facility: local4
protocols: imaps
listen: *, [::]
ssl_cert_file: /usr/local/etc/ssl/certs/dovecot.pem
ssl_key_file: /usr/local/etc/ssl/private/dovecot.pem
ssl_cipher_list: ALL:!LOW:!SSLv2
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
login_max_processes_count: 8
login_max_connections: 32
max_mail_processes: 32
mail_privileged_group: mail
mail_debug: yes
mbox_write_locks: fcntl
namespace:
type: private
separator: /
prefix: #mbox/
location: mbox:~/mail:INBOX=/var/mail/%u
inbox: yes
hidden: yes
list: yes
subscriptions: yes
namespace:
type: private
separator: /
location: maildir:/mail/imap/%u:LAYOUT=fs
list: yes
subscriptions: yes
auth default:
mechanisms: cram-md5
verbose: yes
debug: yes
passdb:
driver: pam
passdb:
driver: passwd-file
args: /usr/local/etc/dovecot-md5
userdb:
driver: passwd
Axel Luttgens
2009-07-13 12:10:18 UTC
Permalink
Post by Jim Reid
Hi Timo. Thanks again for your help. I've got things just about
working as planned. There's one minor irritation however. Users see
a strange mailbox icon at the top of their list of mailboxes on the
dovecot server. It's called #mbox and has a > symbol next to it
indicating that it contains nested mailbox(es). The icon for the
mailbox not filled in, which is usually how Apple Mail indicates
there's something wrong with the mailbox. In this case, it's not
possible to put messages in #mbox. Is there a simple way to make
this mailbox disappear from the list displayed by the client?
Hello Jim,

Could you try with " list = no" for your first namespace definition?

Axel
Jim Reid
2009-07-13 12:54:04 UTC
Permalink
Post by Axel Luttgens
Could you try with " list = no" for your first namespace definition?
Doh! This does the job!! Thanks very much Axel. I'm drinking too much
coffee if I miss something that obvious.... :-)

Axel Luttgens
2009-07-10 10:05:09 UTC
Permalink
Post by Jim Reid
[...]
Thanks for the quick response Timo. Sadly, your suggestion doesn't
look as if it'll work because there are many non-empty parent
mailboxes that have to get shifted to the new dovecot server. ie
There are messages in sub as well as sub/box: too many to move to
sub/whatever. And there are many of these sorts of folders too. Some
mailboxes are even more deeply nested with subfolders: sub/box1/box2
where sub/box1 holds messages. Looks like an all-mbox solution isn't
going to be viable at all. Oh well.
[...]
Hello Jim,

The question may also be: "where are your users coming from?".
It seems you are in the process of changing your server, or?
Could you describe your current server, its setup, and show an example
of how those nested dual-use mailboxes are stored on it?
Who knows, there's perhaps an easy way to re-arrange the layout on the
server so as to (almost) transparently migrate to Dovecot?

Axel
Axel Luttgens
2009-07-10 10:04:19 UTC
Permalink
Post by Jim Reid
Hi. I've been fighting a losing battle to get Apple Mail and dovecot
to play nice. When dovecot is told to use mbox-style mailboxes, it's
not possible to create child mailboxes. Apple Mail whines "The IMAP
command ?CREATE? failed with server error: Mailbox doesn't allow
inferior mailboxes.". I've looked through the documentation, the
wiki and searched the mail archives without finding a solution. Can
anyone help?
[...]
Hello Jim,

Timo already replied with some hints related to your config and the
LAYOUT setting.

I just wanted to add that Mail.app seems to correctly honor the IMAP
conventions as far as naming is concerned, so that the creation of
child mailboxes is perfectly possible from Mail.app's GUI.

Of course, if the server doesn't allow for dual-use mailboxes, neither
will Mail.app... [1]

So, let's assume an fs layout for mboxes and "/" as hierarchy separator.
If one selects the "New mailbox..." menu item and ask to create an
item named "aaa/" somewhere on the server, this will create a
directory named "aaa" on the server and appear as a greyed folder in
the GUI.
The same way, one may ask to create "aaa/bbb/ccc" at the same
location, or to create "bbb/ccc" under "aaa", or to create "bbb/"
under "aaa" and then "ccc" under "bbb", and everything works as
expected ("ccc" now being a file on the server and appearing as a blue
folder in the GUI).

Axel


[1] Note that Mail.app allows for dual-use mailboxes in the local
storage, but this is thru a trick. If, at the same level, one has:
- a directory named "aaa"
- a directory named "aaa.mbox"
this will appear as a single blue folder named "aaa" in the GUI, and
that folder may contain both messages (they are stored in "aaa.mbox")
and other mailboxes (they are stored in "aaa").
Loading...