[Dovecot] lda and mail_location
I have the following set in the main level of my dovecot.conf file:
mail_location = maildir:/var/mail/virtual/%u
I decided to enable the lda protocol for local delivery from postfix,
so I could use sieve plugins. The lda protocol seems to ignore
settings in the rest of the dovecot.conf file, however, such as the
above. Unless lda has a pre-existing maildir mailbox, it can't
create one. How do I give lda defaults to follow, if the above
statement doesn't do it?
Here is the output of dovecot -n
Thanks!
# /etc/dovecot/dovecot.conf log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap pop3 imaps pop3s listen: 127.0.0.1 ssl_listen: [::] ssl_cert_file: /etc/ssl/private/mail.antsclimbtree.com.pem ssl_key_file: /etc/ssl/private/mail.antsclimbtree.com.pem login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login valid_chroot_dirs: /var/mail verbose_proctitle: yes first_valid_uid: 8 last_valid_uid: 8 first_valid_gid: 8 last_valid_gid: 8 mail_extra_groups: mail mail_location: maildir:/var/mail/virtual/%u maildir_copy_with_hardlinks: yes mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): outlook-idle pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xu%08Xv pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh namespace: type: private separator: / inbox: yes auth default: mechanisms: plain login username_format: %Lu verbose: yes passdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf userdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 384 user: mail group: mail
On Wed, 2007-06-20 at 00:18 -0700, Mark Edwards wrote:
I have the following set in the main level of my dovecot.conf file:
mail_location = maildir:/var/mail/virtual/%u
I decided to enable the lda protocol for local delivery from postfix,
so I could use sieve plugins. The lda protocol seems to ignore
settings in the rest of the dovecot.conf file, however, such as the
above. Unless lda has a pre-existing maildir mailbox, it can't
create one. How do I give lda defaults to follow, if the above
statement doesn't do it?
Sounds like it's using a wrong config file. Try running explicitly with deliver -c /etc/dovecot/dovecot.conf
Or set mail_debug=yes and check what it writes to logs.
On Jun 27, 2007, at 1:30 PM, Timo Sirainen wrote:
On Wed, 2007-06-20 at 00:18 -0700, Mark Edwards wrote:
I have the following set in the main level of my dovecot.conf file:
mail_location = maildir:/var/mail/virtual/%u
I decided to enable the lda protocol for local delivery from postfix, so I could use sieve plugins. The lda protocol seems to ignore settings in the rest of the dovecot.conf file, however, such as the above. Unless lda has a pre-existing maildir mailbox, it can't create one. How do I give lda defaults to follow, if the above statement doesn't do it?
Sounds like it's using a wrong config file. Try running explicitly
with deliver -c /etc/dovecot/dovecot.confOr set mail_debug=yes and check what it writes to logs.
Well, deliver is clearly seeing /etc/dovecot/dovecot.conf because
other settings are obviously influencing it, and if it can't read
that file it errors out. But, just for good measure I followed your
suggestions.
Unless I specifically have /var/mail/virtual returned as home in the
ldap lookup, deliver can't find the directory. In other words, it
doesn't seem to respect the above mail_location setting. In
addition, if I don't have a pre-existing maildir in the target
directory, deliver complains it doesn't know what format to use,
further evidence that it is ignoring mail_location.
Is deliver really supposed to be reading that setting? It seems to
ignore it in my case, even though the setting is correctly read by
dovecot for purposes of reading and manipulating the mailboxes.
Here's a sample log:
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): Loading modules
from directory: /usr/lib/dovecot/modules/lda
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): Module loaded: /
usr/lib/dovecot/modules/lda/lib90_cmusieve_plugin.so
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input:
mark@antsclimbtree.com
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input:
mail=mark
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input: uid=8
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input: gid=8
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): maildir
autodetect: stat(mark/cur) failed: No such file or directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): mbox
autodetect: data=mark
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): mbox
autodetect: INBOX file: stat(mark) failed: No such file or directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): mbox
autodetect: has .imap/: stat(mark/.imap) failed: No such file or
directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): mbox
autodetect: has inbox: stat(mark/inbox) failed: No such file or
directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): mbox
autodetect: has mbox: stat(mark/mbox) failed: No such file or directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): dbox
autodetect: stat(mark/inbox/dbox-Mails) failed: No such file or
directory
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): Ambiguous mail
location setting, don't know what to do with it: mark (try prefixing
it with mbox: or maildir:)
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): Failed to
create storage for 'mark@antsclimbtree.com' with mail 'mark'
-- Mark Edwards
On 28.6.2007, at 5.12, Mark Edwards wrote:
Unless I specifically have /var/mail/virtual returned as home in
the ldap lookup, deliver can't find the directory. In other words,
it doesn't seem to respect the above mail_location setting. In
addition, if I don't have a pre-existing maildir in the target
directory, deliver complains it doesn't know what format to use,
further evidence that it is ignoring mail_location.
userdb can override mail_location:
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input:
mail=mark
You're overriding it with "mark".
On Jun 28, 2007, at 6:14 AM, Timo Sirainen wrote:
On 28.6.2007, at 5.12, Mark Edwards wrote:
Unless I specifically have /var/mail/virtual returned as home in
the ldap lookup, deliver can't find the directory. In other
words, it doesn't seem to respect the above mail_location
setting. In addition, if I don't have a pre-existing maildir in
the target directory, deliver complains it doesn't know what
format to use, further evidence that it is ignoring mail_location.userdb can override mail_location:
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input:
mail=markYou're overriding it with "mark".
I see. Well, my aim is to avoid having to prefix my mailbox entries
in my LDAP database with "maildir:", and to avoid having to deal with
the home attribute in LDAP at all if possible. I want to set those
things globally.
My dovecot-ldap.conf contains: user_attrs = homeDirectory=home,mailbox=mail
I'm setting mailbox=mail because otherwise dovecot uses postfix's
destination, which is the entire destination email address. Are my
only choices to either use postfix's supplied destination, or to
override that and explicitly set the home directory and mailbox type
in the LDAP database?
Thanks.
-- Mark Edwards
On Thu, 2007-06-28 at 08:17 -0700, Mark Edwards wrote:
Jun 27 18:56:52 mini deliver(mark@antsclimbtree.com): auth input:
mail=markYou're overriding it with "mark".
I see. Well, my aim is to avoid having to prefix my mailbox entries
in my LDAP database with "maildir:", and to avoid having to deal with
the home attribute in LDAP at all if possible. I want to set those
things globally.My dovecot-ldap.conf contains: user_attrs = homeDirectory=home,mailbox=mail
I'm setting mailbox=mail because otherwise dovecot uses postfix's
destination, which is the entire destination email address. Are my
only choices to either use postfix's supplied destination, or to
override that and explicitly set the home directory and mailbox type
in the LDAP database?
Do you mean you want to drop the domain part for all users (use %n and not %u in mail_location), or do you mean you just want to handle some aliases? I think you should be able to handle aliases on Postfix side.
On Jun 28, 2007, at 9:04 AM, Timo Sirainen wrote:
My dovecot-ldap.conf contains: user_attrs = homeDirectory=home,mailbox=mail
I'm setting mailbox=mail because otherwise dovecot uses postfix's destination, which is the entire destination email address. Are my only choices to either use postfix's supplied destination, or to override that and explicitly set the home directory and mailbox type in the LDAP database?
Do you mean you want to drop the domain part for all users (use %n and not %u in mail_location), or do you mean you just want to handle some aliases? I think you should be able to handle aliases on Postfix side.
The former. I get it now, I didn't understand the interaction and
hierarchy between userdb settings and global settings.
One thing that confused me is that setting the home attribute in
userdb doesn't override mail_location, and in fact doesn't seem to
have any affect unless the mail attribute is set. So, is it correct
that mail_location is the rule, unless mail is set in user_attrs, in
which case mail_location is overridden with the attributes from
user_attrs? Is that how it works?
-- Mark Edwards
On Thu, 2007-06-28 at 10:31 -0700, Mark Edwards wrote:
One thing that confused me is that setting the home attribute in
userdb doesn't override mail_location, and in fact doesn't seem to
have any affect unless the mail attribute is set.
Home directory is used wherever you have ~/ or %h. Or in your case because you tried to use a relative mail_location path and Dovecot chdired to home dir.
So, is it correct
that mail_location is the rule, unless mail is set in user_attrs, in
which case mail_location is overridden with the attributes from
user_attrs? Is that how it works?
Right. And you can override pretty much any other setting from userdb as well.
Hmm. Perhaps userdb should be returning mail_location also instead of mail to make this more understandable.
On Jun 28, 2007, at 12:38 PM, Timo Sirainen wrote:
Home directory is used wherever you have ~/ or %h. Or in your case because you tried to use a relative mail_location path and Dovecot chdired to home dir.
So, is it correct that mail_location is the rule, unless mail is set in user_attrs, in which case mail_location is overridden with the attributes from user_attrs? Is that how it works?
Right. And you can override pretty much any other setting from
userdb as well.Hmm. Perhaps userdb should be returning mail_location also instead of mail to make this more understandable.
That's not a bad idea. The best thing though would be better
documentation of exactly how this all interacts, or perhaps I'm just
not finding it. I've been through the wiki.
One thing that still puzzles me is why userdb has to be set at all.
In my case its totally unnecessary as far as I can tell, yet I get
errors if I don't set it or set it to nothing. I have it set to
return the home attribute right now, but that isn't used.
Anyway, otherwise it all makes perfect sense to me now. Thank you
for your patience and time!
-- Mark Edwards
On Thu, 2007-06-28 at 12:52 -0700, Mark Edwards wrote:
One thing that still puzzles me is why userdb has to be set at all.
In my case its totally unnecessary as far as I can tell, yet I get
errors if I don't set it or set it to nothing. I have it set to
return the home attribute right now, but that isn't used.
It must return uid and gid.
For v1.1 I'll add new global mail_uid and mail_gid settings. Then if you use them userdb won't be needed.
On Jun 28, 2007, at 1:01 PM, Timo Sirainen wrote:
On Thu, 2007-06-28 at 12:52 -0700, Mark Edwards wrote:
One thing that still puzzles me is why userdb has to be set at all. In my case its totally unnecessary as far as I can tell, yet I get errors if I don't set it or set it to nothing. I have it set to return the home attribute right now, but that isn't used.
It must return uid and gid.
For v1.1 I'll add new global mail_uid and mail_gid settings. Then
if you use them userdb won't be needed.
I am using user_global_uid and user_global_gid, and so there is no
reason for userdb to return uid and gid ini my case, in fact I have
it set to return only home, and that's only to avoid the error.
-- Mark Edwards
On 28.6.2007, at 23.10, Mark Edwards wrote:
For v1.1 I'll add new global mail_uid and mail_gid settings. Then
if you use them userdb won't be needed.I am using user_global_uid and user_global_gid, and so there is no
reason for userdb to return uid and gid ini my case, in fact I have
it set to return only home, and that's only to avoid the error.
But the user_global_uid/gid are in your dovecot-ldap.conf, so it's
your userdb ldap that is still returning them. :)
On Thu, 2007-06-28 at 23:12 +0300, Timo Sirainen wrote:
On 28.6.2007, at 23.10, Mark Edwards wrote:
For v1.1 I'll add new global mail_uid and mail_gid settings. Then
if you use them userdb won't be needed.I am using user_global_uid and user_global_gid, and so there is no
reason for userdb to return uid and gid ini my case, in fact I have
it set to return only home, and that's only to avoid the error.But the user_global_uid/gid are in your dovecot-ldap.conf, so it's
your userdb ldap that is still returning them. :)
Oh, but it's not required to use userdb ldap if you don't need to have a home dir returned. You can use userdb static instead: http://wiki.dovecot.org/UserDatabase/Static
On Jun 28, 2007, at 1:12 PM, Timo Sirainen wrote:
On 28.6.2007, at 23.10, Mark Edwards wrote:
For v1.1 I'll add new global mail_uid and mail_gid settings. Then
if you use them userdb won't be needed.I am using user_global_uid and user_global_gid, and so there is no
reason for userdb to return uid and gid ini my case, in fact I
have it set to return only home, and that's only to avoid the error.But the user_global_uid/gid are in your dovecot-ldap.conf, so it's
your userdb ldap that is still returning them. :)
Well, at the risk of pushing this needlessly... not explicitly
setting the user_attrs in dovecot-ldap.conf shouldn't cause errors,
as long as the necessary information is present. In my case, uid,
gid, mail, and home are all set in other places, and yet I still have
to have user_attrs defined. It might be nit-picking, but it is
confusing and makes it a little hard to figure out what settings are
actually affecting my setup.
Anyway, thanks again.
-- Mark Edwards
participants (2)
-
Mark Edwards
-
Timo Sirainen