[Dovecot] Turning on autocreate of maildirs - how?
Hi all,
I have a dovecot v2.2.7 installation, and I would like dovecot to autocreate the Maildir mailbox when those mailboxes don't exist. Following the instructions at http://wiki2.dovecot.org/MailboxSettings have had no effect, the errors below are reported.
As soon as I create the Maildir manually with maildirmake fetching mail starts working fine, so all of the messages about the directory being ambiguous seem to be a red herring.
Anyone know how to turn this on?
Mar 11 16:02:37 monica dovecot: imap: Debug: Added userdb setting: mail=/home/vmail/test@sharp.fm/ Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: Effective uid=517, gid=517, home= Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=/home/vmail/test@sharp.fm/ Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: mdbox autodetect: stat(/home/vmail/test@sharp.fm/storage) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: sdbox autodetect: stat(/home/vmail/test@sharp.fm/mailboxes) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: maildir autodetect: stat(/home/vmail/test@sharp.fm/cur) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: mbox autodetect: INBOX file: stat(/home/vmail/test@sharp.fm) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: mbox autodetect: has .imap/: stat(/home/vmail/test@sharp.fm/.imap) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: mbox autodetect: has inbox: stat(/home/vmail/test@sharp.fm/inbox) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: mbox autodetect: has mbox: stat(/home/vmail/test@sharp.fm/mbox) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Debug: sdbox autodetect: stat(/home/vmail/test@sharp.fm/mailboxes) failed: No such file or directory Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Error: user test@sharp.fm: Initialization failed: Namespace '': Ambiguous mail location setting, don't know what to do with it: /home/vmail/test@sharp.fm/ (try prefixing it with mbox: or maildir:) Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Error: Invalid user settings. Refer to server log for more information.
Regards, Graham
On 2014-03-11 17:04, Graham Leggett wrote: [..]
Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Error: user test@sharp.fm: Initialization failed: Namespace '': Ambiguous mail location setting, don't know what to do with it: /home/vmail/test@sharp.fm/ (try prefixing it with mbox: or maildir:)
This line is important the important one and tells you what to do.
(effectively dovecot does not know the format of the mail directory hence it does not know how to create it...)
Greets, Jeroen
On 11 Mar 2014, at 6:18 PM, Jeroen Massar <jeroen@massar.ch> wrote:
On 2014-03-11 17:04, Graham Leggett wrote: [..]
Mar 11 16:02:37 monica dovecot: imap(test@sharp.fm): Error: user test@sharp.fm: Initialization failed: Namespace '': Ambiguous mail location setting, don't know what to do with it: /home/vmail/test@sharp.fm/ (try prefixing it with mbox: or maildir:)
This line is important the important one and tells you what to do.
(effectively dovecot does not know the format of the mail directory hence it does not know how to create it…)
For years the trailing slash has indicated the mailbox format as maildir, and dovecot has been happily autodetecting these maildirs without a problem.
In our case in addition to dovecot we have a combination of postfix and a legacy courier-imap, how will these the be affected by the addition of "maildir:"?
What I don't understand is why autocreate is ignoring the long standing convention that the trailing slash indicates maildir, and whether this is intentional or whether there is some reason for it.
Regards, Graham
On 11 Mar 2014, at 6:25 PM, Graham Leggett <minfrin@sharp.fm> wrote:
For years the trailing slash has indicated the mailbox format as maildir, and dovecot has been happily autodetecting these maildirs without a problem.
In our case in addition to dovecot we have a combination of postfix and a legacy courier-imap, how will these the be affected by the addition of "maildir:"?
What I don't understand is why autocreate is ignoring the long standing convention that the trailing slash indicates maildir, and whether this is intentional or whether there is some reason for it.
Giving the different prefix a try on a test account, a mailbox directory is created, but the rest of the maidir directories (new, cur, tmp) aren't created, and the error below is returned.
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes"
Mar 11 17:27:20 monica dovecot: imap: Debug: Added userdb setting: mail=maildir:/home/vmail/test@sharp.fm/ Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Debug: Effective uid=517, gid=517, home= Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/vmail/test@sharp.fm/ Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Debug: maildir++: root=/home/vmail/test@sharp.fm, index=, indexpvt=, control=, inbox=/home/vmail/test@sharp.fm, alt= Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Debug: Namespace : type=private, prefix=INBOX., sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/vmail/test@sharp.fm/ Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Debug: maildir++: root=/home/vmail/test@sharp.fm, index=, indexpvt=, control=, inbox=/home/vmail/test@sharp.fm, alt= Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes Mar 11 17:27:20 monica dovecot: imap(test@sharp.fm): Error: Invalid user settings. Refer to server log for more information.
I have two namespaces defined, I am assuming this is wrong:
namespace inbox { inbox = yes mailbox Trash { auto = subscribe special_use = \Trash } mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Sent { auto = subscribe # autocreate and autosubscribe the Sent mailbox special_use = \Sent } mailbox "Sent Messages" { auto = no special_use = \Sent } mailbox Junk { auto = create # autocreate Spam, but don't autosubscribe special_use = \Junk } mailbox virtual/All { # if you have a virtual "All messages" mailbox auto = no special_use = \All } }
namespace { type = private separator = . prefix = INBOX. inbox = yes }
Regards, Graham
On 11 Mar 2014, at 7:32 PM, Graham Leggett <minfrin@sharp.fm> wrote:
Giving the different prefix a try on a test account, a mailbox directory is created, but the rest of the maidir directories (new, cur, tmp) aren't created, and the error below is returned.
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes"
This is somewhat of a moot point - the addition of maildir: breaks maildrop:
Mar 11 17:35:36 monica postfix/pipe[25561]: 10E29804B4: to=<test@sharp.fm>, relay=maildrop, delay=0.21, delays=0.15/0.02/0/0.03, dsn=4.3.0, status =deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to change to home directory. )
Is there a way to get dovecot autocreate to work without fiddling with the paths? For example, declare a global maildir default?
Regards, Graham
On 2014-03-11 18:41 , Graham Leggett wrote:
On 11 Mar 2014, at 7:32 PM, Graham Leggett <minfrin@sharp.fm> wrote:
Giving the different prefix a try on a test account, a mailbox directory is created, but the rest of the maidir directories (new, cur, tmp) aren't created, and the error below is returned.
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes"
This is somewhat of a moot point - the addition of maildir: breaks maildrop:
Mar 11 17:35:36 monica postfix/pipe[25561]: 10E29804B4: to=<test@sharp.fm>, relay=maildrop, delay=0.21, delays=0.15/0.02/0/0.03, dsn=4.3.0, status =deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to change to home directory. )
Is there a way to get dovecot autocreate to work without fiddling with the paths? For example, declare a global maildir default?
See http://wiki2.dovecot.org/maildrop that has a global default settings file documented.
Personally, I am in favor of using LMTP (http://wiki2.dovecot.org/LMTP) especially as you gain SIEVE powers (when enabled) ;)
Grets, Jeroen
On 11/03/14 17:41, Graham Leggett wrote:
On 11 Mar 2014, at 7:32 PM, Graham Leggett <minfrin@sharp.fm> wrote:
Giving the different prefix a try on a test account, a mailbox directory is created, but the rest of the maidir directories (new, cur, tmp) aren't created, and the error below is returned.
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes" This is somewhat of a moot point - the addition of maildir: breaks maildrop:
Mar 11 17:35:36 monica postfix/pipe[25561]: 10E29804B4: to=<test@sharp.fm>, relay=maildrop, delay=0.21, delays=0.15/0.02/0/0.03, dsn=4.3.0, status =deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to change to home directory. )
Is there a way to get dovecot autocreate to work without fiddling with the paths? For example, declare a global maildir default?
Regards, Graham
I have 15-mailboxes.conf where there are statements
auto=create or auto=subscribe
commented out inside namespace segments. It is where all the special use mailboxes get defined. I think the default is probably no - I can create folders with thunderbird specifically, but I don't think it is creating them automatically. I have auto = create within my special use mailboxes, and they did get created automatically when I needed them (I was deleting Trash for instance, but it sprung back after I had done that when it was next needed.
-- Alan Chandler http://www.chandlerfamily.org.uk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 11 Mar 2014, Graham Leggett wrote:
On 11 Mar 2014, at 7:32 PM, Graham Leggett <minfrin@sharp.fm> wrote:
Giving the different prefix a try on a test account, a mailbox directory is created, but the rest of the maidir directories (new, cur, tmp) aren't created, and the error below is returned.
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes"
This is somewhat of a moot point - the addition of maildir: breaks maildrop:
Mar 11 17:35:36 monica postfix/pipe[25561]: 10E29804B4: to=<test@sharp.fm>, relay=maildrop, delay=0.21, delays=0.15/0.02/0/0.03, dsn=4.3.0, status =deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to change to home directory. )
Is there a way to get dovecot autocreate to work without fiddling with the paths? For example, declare a global maildir default?
What's your UserDB? In some message you've mentioned LDAP. With "Attribute templates" you can prefix the location with "maildir:". If you do not return mail in the userdb, the global mail_location is used.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUx/9b3D1/YhP6VMHAQLFJgf+LTH0B8s4SGbqL2jueZrwApQfdmYrQE6h 0z9wuYEnPOBWJIvs2CI1M/H3cNzXXwyzl7ALFYWdAz6QMxHIqp/De3J1KhDKg8p+ 1wxiQym1sOz4ieLo+/YYzSHRpwXEMNsl9l2581PvhN/IUKK/FbLL+H3wMhxoVOhe m4XFS4Ip/bIqr8ZpYeIZhd9dFmDkBz1KhTw2ZgEBZBKyqRrJoaU6rg3nnq/QGYRF yaH4QsB3YP35hTG/7r3WsEWSdBVlEKYQOHwSmACDbIFpPHBW+FL624owGhfR0ZGK g0URKSvrVDRsae+DDg4CiqlDIHjHiGS+bJQgt54ox50acVz29CAHLQ== =r1Sl -----END PGP SIGNATURE-----
On 12 Mar 2014, at 8:23 AM, Steffen Kaiser <skdovecot@smail.inf.fh-brs.de> wrote:
What's your UserDB? In some message you've mentioned LDAP. With "Attribute templates" you can prefix the location with "maildir:". If you do not return mail in the userdb, the global mail_location is used.
Turns out this was the key - when I changed
user_attrs = mailMessageStore=mail
to
user_attrs = mailMessageStore=mail=maildir:%$
the autocreate started working successfully with the original path values, and maildrop is happy.
Thanks you for this, I appreciate it.
Regards, Graham
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 11 Mar 2014, Graham Leggett wrote:
The key is the message "Error: user test@sharp.fm: Initialization failed: namespace configuration error: There can be only one namespace with inbox=yes"
I have two namespaces defined, I am assuming this is wrong:
namespace inbox { inbox = yes mailbox Trash { auto = subscribe
[...]
} }
namespace { type = private separator = . prefix = INBOX. inbox = yes }
I guess you've figured out already, you need to name both namespaces the same, e.g. "" or "inbox".
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUx/8MXD1/YhP6VMHAQLS8wgAhjBoTS8TJP+Igf4qjYgL/o/j9eytkI/2 IYrHOVgMYH/cTjNlawx54PktyMXb6RP8+b2KV93aj0GBo0j8WODM/6QxN0DcTflI JWe46EYjb2WYqEYHmTM/r9TymCaMmZL/5Lwyivxc9Hi9UIrZQ+pC3PLRmxOGgRIH btm/6cxWnU0WWBnIbolgrgEriXsUDDEf9NZsfSYeBN8t86/Cv/+DZVuf3MQWqaWc SzQK8tq/3ZX/HJ0r+t8fWTQTRLXV1jk1VszIfPFokNtudCHDX0crL73ROdVWpLh7 DjV+k3FEQ2ePmNbciYtDnAGMl5RYmpbOZhb8H4HlOus31Bu4qVqfVA== =rXPE -----END PGP SIGNATURE-----
participants (4)
-
Alan Chandler
-
Graham Leggett
-
Jeroen Massar
-
Steffen Kaiser