[Dovecot] Dovecot 2.2.4 does not create home directory?
Hi,
Does not create, or something I did wrong?
Here http://wiki2.dovecot.org/VirtualUsers/Home it is written
Home vs. mail directory Home directory shouldn't be the same as mail directory. It's possible to do that, but you might run into trouble with it sooner or later. Some problems with this are:
and
Ways to set up home directory The home directory is the same as the mail directory. If for example home=/var/vmail/domain/user/ mail=/var/vmail/domain/user/mail/, set: mail_home = /var/vmail/%d/%n mail_location = maildir:~/mail
I think I've done it so.
And yet, here http://wiki.dovecot.org/HowTo/SimpleVirtualInstall it is written Users can be added by editing this file. Dovecot automatically notices the new users immediately after they're added. It also creates their home directories when the user logs in.
However, the directory is not created.
My config:
# dovecot -n # 2.2.4: /etc/dovecot/dovecot.conf # OS: Linux 3.9.6 x86_64 Slackware 14.0 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login digest-md5 cram-md5 rpa apop auth_verbose = yes auth_verbose_passwords = plain debug_log_path = /var/log/dovecot/dovecot.debug.log disable_plaintext_auth = no info_log_path = /var/log/dovecot/dovecot.info.log lda_mailbox_autocreate = yes listen = 192.168.1.1 log_path = /var/log/dovecot/dovecot.log mail_debug = yes mail_gid = dovecot mail_uid = dovecot managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Sent { auto = subscribe special_use = \Sent } mailbox Spam { auto = subscribe special_use = \Junk } mailbox Trash { auto = subscribe special_use = \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { antispam_allow_append_to_spam = NO antispam_backend = dspam antispam_debug_target = syslog antispam_dspam_args = --user;%Lu;--deliver=;--source=error;--signature=%%s antispam_dspam_binary = /usr/bin/dspam antispam_dspam_notspam = --class=innocent antispam_dspam_result_blacklist = Virus;Blocklisted;Blacklisted antispam_dspam_result_header = X-DSPAM-Result antispam_dspam_spam = --class=spam antispam_signature = X-DSPAM-Signature antispam_signature_missing = move antispam_skip_from_line = NO antispam_spam = Spam;spam;SPAM;Junk;junk;JUNK; antispam_trash = Trash;trash;Deleted;deleted;Deleted Items;Deleted Messages; antispam_verbose_debug = 1 sieve = ~/.dovecot.sieve sieve_default = /etc/dovecot/sieve/default.sieve sieve_dir = ~/sieve sieve_global_dir = /etc/dovecot/sieve/ } protocols = imap pop3 lmtp sieve service lmtp { inet_listener lmtp { address = 127.0.0.1 port = 24 } } service managesieve-login { inet_listener sieve { port = 4190 } } ssl_cert =
# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
driver = pgsql
connect = host=localhost dbname=dbname user=user password=password
default_pass_scheme = PLAIN
password_query = SELECT password FROM users WHERE email = '%u' AND enabled
= 1
user_query = SELECT
concat('/var/spool/vmail/', home) AS home,
concat('maildir:', maildir) AS mail
FROM users WHERE email = '%u' AND enabled = 1
where in db home = "example.com/test/" maildir = "Maildir/"
/etc/passwd dovecot:x:1202:202:Dovecot:/dev/null:/bin/bash dovenull:x:1203:203:Dovenull:/dev/null:/bin/false
/etc/group dovecot:x:202: dovenull:x:203:
cd /var/spool # ls -l drwxrwxr-x 4 dovecot dovecot 4096 Jul 17 12:41 vmail
/var/log/dovecot/dovecot.debug.log
Jul 17 12:49:41 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth Jul 17 12:49:41 auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat Jul 17 12:49:41 auth: Debug: auth client connected (pid=10501) Jul 17 12:49:41 auth: Debug: client in: AUTH 1 CRAM-MD5 service=imap session=RONGFqLhrgDAqAPO lip=192.168.1.1 rip=192.168.1.2 lport=143 rport=50094 Jul 17 12:49:41 auth: Debug: client passdb out: CONT 1 PDk3MDcyMzA1OTYxMTU0MzguMTM3Mzk4NjE4MUBtYWlsPg== Jul 17 12:49:41 auth: Debug: client in: CONT 1 dGVzdEBoYXJkcmV2aWV3LnJ1IDFhOTE0NDBmZDk1OGE5ZWI0MWVkN2Q4ZDdhOGIzNzFi (previous base64 data may contain sensitive data) Jul 17 12:49:41 auth: Debug: sql(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): query: SELECT password FROM users WHERE email = 'test@example.com' AND enabled = 1 Jul 17 12:49:41 auth: Debug: password(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): Generating CRAM-MD5 from user 'test@example.com@', password 'test' Jul 17 12:49:41 auth: Debug: password(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): Credentials: 6062bc903ac97de43f0b5d33ebe8c1a63bb9ae1a88ec39cf6fd85a645de8c63a Jul 17 12:49:41 auth: Debug: client passdb out: OK 1 user= test@example.com
Jul 17 12:49:41 auth: Debug: master in: REQUEST 2206334977 10501 1 49e1fcdcc5e1c2becb50c3b47d31cdeb session_pid=10506 Jul 17 12:49:41 auth: Debug: sql(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): SELECT concat('/var/spool/vmail/', home) AS home, concat('maildir:', maildir) AS mail FROM users WHERE email = 'test@example.com' AND enabled = 1 Jul 17 12:49:41 auth: Debug: master userdb out: USER 2206334977 test@example.com home=/var/spool/vmail/example.com/test/ mail=maildir:Maildir/ auth_token=670c839af976e3c0c74db1754e28ff40a2557095 Jul 17 12:49:41 imap: Debug: Loading modules from directory: /usr/lib64/dovecot Jul 17 12:49:41 imap: Debug: Module loaded: /usr/lib64/dovecot/lib90_antispam_plugin.so Jul 17 12:49:41 imap: Debug: Added userdb setting: mail=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: Effective uid=1202, gid=202, home=/var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Home dir not found: /var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: maildir++: root=Maildir, index=, indexpvt=, control=, inbox=Maildir, alt= Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Maildir doesn't exist yet, using default permissions Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Using permissions from Maildir: mode=0700 gid=default
Thank you!
Regards, Dmitry
The MTA/MDA creates home directories during delivery.
On 17 July 2013 15:32, Dmitry . rcpt.dmitry@gmail.com wrote:
Hi,
Does not create, or something I did wrong?
Here http://wiki2.dovecot.org/VirtualUsers/Home it is written
Home vs. mail directory Home directory shouldn't be the same as mail directory. It's possible to do that, but you might run into trouble with it sooner or later. Some problems with this are:
and
Ways to set up home directory The home directory is the same as the mail directory. If for example home=/var/vmail/domain/user/ mail=/var/vmail/domain/user/mail/, set: mail_home = /var/vmail/%d/%n mail_location = maildir:~/mail
I think I've done it so.
And yet, here http://wiki.dovecot.org/HowTo/SimpleVirtualInstall it is written Users can be added by editing this file. Dovecot automatically notices the new users immediately after they're added. It also creates their home directories when the user logs in.
However, the directory is not created.
My config:
# dovecot -n # 2.2.4: /etc/dovecot/dovecot.conf # OS: Linux 3.9.6 x86_64 Slackware 14.0 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login digest-md5 cram-md5 rpa apop auth_verbose = yes auth_verbose_passwords = plain debug_log_path = /var/log/dovecot/dovecot.debug.log disable_plaintext_auth = no info_log_path = /var/log/dovecot/dovecot.info.log lda_mailbox_autocreate = yes listen = 192.168.1.1 log_path = /var/log/dovecot/dovecot.log mail_debug = yes mail_gid = dovecot mail_uid = dovecot managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Sent { auto = subscribe special_use = \Sent } mailbox Spam { auto = subscribe special_use = \Junk } mailbox Trash { auto = subscribe special_use = \Trash } prefix = } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { antispam_allow_append_to_spam = NO antispam_backend = dspam antispam_debug_target = syslog antispam_dspam_args = --user;%Lu;--deliver=;--source=error;--signature=%%s antispam_dspam_binary = /usr/bin/dspam antispam_dspam_notspam = --class=innocent antispam_dspam_result_blacklist = Virus;Blocklisted;Blacklisted antispam_dspam_result_header = X-DSPAM-Result antispam_dspam_spam = --class=spam antispam_signature = X-DSPAM-Signature antispam_signature_missing = move antispam_skip_from_line = NO antispam_spam = Spam;spam;SPAM;Junk;junk;JUNK; antispam_trash = Trash;trash;Deleted;deleted;Deleted Items;Deleted Messages; antispam_verbose_debug = 1 sieve = ~/.dovecot.sieve sieve_default = /etc/dovecot/sieve/default.sieve sieve_dir = ~/sieve sieve_global_dir = /etc/dovecot/sieve/ } protocols = imap pop3 lmtp sieve service lmtp { inet_listener lmtp { address = 127.0.0.1 port = 24 } } service managesieve-login { inet_listener sieve { port = 4190 } } ssl_cert =
# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf driver = pgsql connect = host=localhost dbname=dbname user=user password=password default_pass_scheme = PLAIN password_query = SELECT password FROM users WHERE email = '%u' AND enabled = 1 user_query = SELECT
concat('/var/spool/vmail/', home) AS home,
concat('maildir:', maildir) AS mail
FROM users WHERE email = '%u' AND enabled = 1where in db home = "example.com/test/" maildir = "Maildir/"
/etc/passwd dovecot:x:1202:202:Dovecot:/dev/null:/bin/bash dovenull:x:1203:203:Dovenull:/dev/null:/bin/false
/etc/group dovecot:x:202: dovenull:x:203:
cd /var/spool # ls -l drwxrwxr-x 4 dovecot dovecot 4096 Jul 17 12:41 vmail
/var/log/dovecot/dovecot.debug.log
Jul 17 12:49:41 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth Jul 17 12:49:41 auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat Jul 17 12:49:41 auth: Debug: auth client connected (pid=10501) Jul 17 12:49:41 auth: Debug: client in: AUTH 1 CRAM-MD5 service=imap session=RONGFqLhrgDAqAPO lip=192.168.1.1 rip=192.168.1.2 lport=143 rport=50094 Jul 17 12:49:41 auth: Debug: client passdb out: CONT 1 PDk3MDcyMzA1OTYxMTU0MzguMTM3Mzk4NjE4MUBtYWlsPg== Jul 17 12:49:41 auth: Debug: client in: CONT 1 dGVzdEBoYXJkcmV2aWV3LnJ1IDFhOTE0NDBmZDk1OGE5ZWI0MWVkN2Q4ZDdhOGIzNzFi (previous base64 data may contain sensitive data) Jul 17 12:49:41 auth: Debug: sql(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): query: SELECT password FROM users WHERE email = 'test@example.com' AND enabled = 1 Jul 17 12:49:41 auth: Debug: password(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): Generating CRAM-MD5 from user 'test@example.com@', password 'test' Jul 17 12:49:41 auth: Debug: password(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): Credentials: 6062bc903ac97de43f0b5d33ebe8c1a63bb9ae1a88ec39cf6fd85a645de8c63a Jul 17 12:49:41 auth: Debug: client passdb out: OK 1 user= test@example.com
Jul 17 12:49:41 auth: Debug: master in: REQUEST 2206334977 10501 1 49e1fcdcc5e1c2becb50c3b47d31cdeb session_pid=10506 Jul 17 12:49:41 auth: Debug: sql(test@example.com,192.168.1.2,<RONGFqLhrgDAqAPO>): SELECT concat('/var/spool/vmail/', home) AS home, concat('maildir:', maildir) AS mail FROM users WHERE email = 'test@example.com' AND enabled = 1 Jul 17 12:49:41 auth: Debug: master userdb out: USER 2206334977 test@example.com home=/var/spool/vmail/example.com/test/ mail=maildir:Maildir/ auth_token=670c839af976e3c0c74db1754e28ff40a2557095 Jul 17 12:49:41 imap: Debug: Loading modules from directory: /usr/lib64/dovecot Jul 17 12:49:41 imap: Debug: Module loaded: /usr/lib64/dovecot/lib90_antispam_plugin.so Jul 17 12:49:41 imap: Debug: Added userdb setting: mail=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: Effective uid=1202, gid=202, home=/var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Home dir not found: /var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: maildir++: root=Maildir, index=, indexpvt=, control=, inbox=Maildir, alt= Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Maildir doesn't exist yet, using default permissions Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Using permissions from Maildir: mode=0700 gid=default
Thank you!
Regards, Dmitry
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 "I can't hear you -- I'm using the scrambler."
Le 17 juil. 2013 à 14:32, "Dmitry ." a écrit :
Hi,
[...]
And yet, here http://wiki.dovecot.org/HowTo/SimpleVirtualInstall it is written Users can be added by editing this file. Dovecot automatically notices the new users immediately after they're added. It also creates their home directories when the user logs in.
Hello Dmitry,
As a side note: the above documents Dovecot 1.x, and you're using 2.2.4.
However, the directory is not created.
[...] Jul 17 12:49:41 imap(test@example.com): Debug: Effective uid=1202, gid=202, home=/var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Home dir not found: /var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: maildir++: root=Maildir, index=, indexpvt=, control=, inbox=Maildir, alt= Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Maildir doesn't exist yet, using default permissions Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Using permissions from Maildir: mode=0700 gid=default
This is a bit strange... are you really sure the home directory hasn't been created? If yes, do you have some messages in your info.log?
Axel
Hello Dmitry,
As a side note: the above documents Dovecot 1.x, and you're using 2.2.4.
I thought that if it works in 1.x to 2.x then be all the more
This is a bit strange... are you really sure the home directory hasn't been created? If yes, do you have some messages in your info.log?
Really ... unfortunately.
/var/log/dovecot/dovecot.info.log Jul 17 12:49:41 imap-login: Info: Login: user=test@example.com, method=CRAM-MD5, rip=192.168.1.2, lip=192.168.1.1, mpid=10506, session=<RONGFqLhrgDAqAPO>
/var/log/dovecot/dovecot.log Jul 17 12:49:41 imap(test@example.com): Error: user test@example.com: Initialization failed: Namespace '': mkdir(Maildir) in directory /var/run/dovecot failed: Permission denied (euid=1202(dovecot) egid=202(dovecot) missing +w perm: /var/run/dovecot, dir owned by 0:0 mode=0755) Jul 17 12:49:41 imap(test@example.com): Error: Invalid user settings. Refer to server log for more information.
2013/7/17 Axel Luttgens AxelLuttgens@swing.be
Le 17 juil. 2013 à 14:32, "Dmitry ." a écrit :
Hi,
[...]
And yet, here http://wiki.dovecot.org/HowTo/SimpleVirtualInstall it is written Users can be added by editing this file. Dovecot automatically notices the new users immediately after they're added. It also creates their home directories when the user logs in.
Hello Dmitry,
As a side note: the above documents Dovecot 1.x, and you're using 2.2.4.
However, the directory is not created.
[...] Jul 17 12:49:41 imap(test@example.com): Debug: Effective uid=1202, gid=202, home=/var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Home dir not found: /var/spool/vmail/example.com/test/ Jul 17 12:49:41 imap(test@example.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:Maildir/ Jul 17 12:49:41 imap(test@example.com): Debug: maildir++: root=Maildir, index=, indexpvt=, control=, inbox=Maildir, alt= Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Maildir doesn't exist yet, using default permissions Jul 17 12:49:41 imap(test@example.com): Debug: Namespace : Using permissions from Maildir: mode=0700 gid=default
This is a bit strange... are you really sure the home directory hasn't been created? If yes, do you have some messages in your info.log?
Axel
On 17-07-13 16:11, Dmitry . wrote:
Isn't the log actually saying what's wrong here? (I didn't see a file listing that shows what owner/permissions are set.)
Initialization failed: Namespace '': mkdir(Maildir) in directory /var/run/dovecot failed: Permission denied (euid=1202(dovecot) egid=202(dovecot) missing +w perm: /var/run/dovecot, dir owned by 0:0 mode=0755) Jul 17 12:49:41 imap(test@example.com): Error: Invalid user settings. Refer to server log for more information.
The log says:
mkdir(Maildir) in directory /var/run/dovecot failed: Permission denied Dovecot couldn't create a directory in /var/run/dovecot. Personally, I would not want to create mail directories there, but if you're okay with it then I'm okay too.
(euid=1202(dovecot) egid=202(dovecot) Dovecot is running as dovecot:dovecot (1202:202).
missing +w perm: /var/run/dovecot, dir owned by 0:0 mode=0755) The base directory is owned by root:root with 755 permissions, so dovecot has no permission to write anything.
I'd choose another place where your mail directories are created and have the correct owner/permissions set.
-- Rob
Le 17 juil. 2013 à 16:11, "Dmitry ." a écrit :
Hello Dmitry,
As a side note: the above documents Dovecot 1.x, and you're using 2.2.4.
I thought that if it works in 1.x to 2.x then be all the more
Probably. :-) But sometimes with incompatibilities.
[...] /var/log/dovecot/dovecot.log Jul 17 12:49:41 imap(test@example.com): Error: user test@example.com: Initialization failed: Namespace '': mkdir(Maildir) in directory /var/run/dovecot failed: Permission denied (euid=1202(dovecot) egid=202(dovecot) missing +w perm: /var/run/dovecot, dir owned by 0:0 mode=0755)
Aaaah!
Those small details... I didn't notice it immediately in your original message:
user_query = SELECT
concat('/var/spool/vmail/', home) AS home,
concat('maildir:', maildir) AS mail \
I guess you should have something like this:
concat('maildir:~/', maildir) AS mail \
HTH, Axel
Thank you very much! You are absolutely right.
2013/7/17 Axel Luttgens AxelLuttgens@swing.be
Le 17 juil. 2013 à 16:11, "Dmitry ." a écrit :
Hello Dmitry,
As a side note: the above documents Dovecot 1.x, and you're using 2.2.4.
I thought that if it works in 1.x to 2.x then be all the more
Probably. :-) But sometimes with incompatibilities.
[...] /var/log/dovecot/dovecot.log Jul 17 12:49:41 imap(test@example.com): Error: user test@example.com: Initialization failed: Namespace '': mkdir(Maildir) in directory /var/run/dovecot failed: Permission denied (euid=1202(dovecot) egid=202(dovecot) missing +w perm: /var/run/dovecot, dir owned by 0:0 mode=0755)
Aaaah!
Those small details... I didn't notice it immediately in your original message:
user_query = SELECT
concat('/var/spool/vmail/', home) AS home,
concat('maildir:', maildir) AS mail \I guess you should have something like this:
concat('maildir:~/', maildir) AS mail \
HTH, Axel
participants (4)
-
Axel Luttgens
-
Dmitry .
-
Odhiambo Washington
-
Rob Sterenborg (lists)