[Dovecot] A few easy pam and virtual domains questions
I am using dovecot with postfix, which was setup to do virtual
domains. Dovecot is setup to authenticate against pam (I know, I know) and knows to look for email in /var/spool/vmail/:
virtual_mailbox_base = /var/spool/vmail
I also have virtual_mailbox_maps defined as
virtual_mailbox_maps = hash:/etc/postfix/vmaps.txt
where I currently only have one account,
% cat /etc/postfix/vmaps.txt raub@domain.com domain.com/raub/ %
Inside raub we have the usual 3 directories, new,cur, and tmp. When I try to login through imap as raub@domain.com@mail.domain.com (i.e. since we are doing the virtual domain thingie, the username has to indicate the domain it belongs to), it will not take it. But, if I login as raub@mail.domain.com, it has no problems authenticating. However, it now expects to retrieve email from /var/spool/vmail/raub instead of /var/spool/vmail/domain.com/raub. Why would it be doing that? Could it be that pam reports raub to be a local account and as a result simply ignoring vmaps.txt?
I asked dovecot to log everything it could. When I checked the log file, the following line screamed at me:
dovecot: May 27 14:40:28 Info: IMAP(raub): maildir++: root=/var/spool/vmail//raub, index=, control=, inbox=/var/spool/vmail//raub
Note the "//" in root and inbox declarations; between those slashes I would expect to be domain.com.
Compounding the problem, and perhaps a clue of how pam is telling what these accounts are, postfix is completely ignoring /var/spool/vmail, placing the emails in /home/raub/Maildir (account is actually being nfs-automounted and user authenticated through ldap through pam). Once again I am guessing it too is being told raub is a local user; am I correct?
Something I forgot to mention: when I first connected to the
mail server as raub using imap, dovecot created a few files. No problem with that. But they were owned by the user raub,
raub@mail $ ls -la /var/spool/vmail/flingingmonkey.com/raub total 32 drwxrwxrwx 5 virtual virtual 4096 May 26 16:23 . drwxr-xr-x 4 virtual virtual 4096 May 21 11:34 .. drwxrwxrwx 2 virtual virtual 4096 May 21 11:34 cur -rw------- 1 raub users 17 May 26 16:23 dovecot-uidlist -rw------- 1 raub users 8 May 26 16:23 dovecot-uidvalidity -rw------- 1 raub users 0 May 26 16:23 dovecot-uidvalidity.4a1c4fa9 -rw------- 1 raub users 140 May 26 16:23 dovecot.index.log drwxrwxrwx 2 virtual virtual 4096 May 21 11:35 new drwxrwxrwx 2 virtual virtual 4096 May 26 16:23 tmp raub@mail $
instead of user virtual, which is the account I have to own /var/spool/vmail and is known to dovecot as
virtual_uid_maps = static:1500 virtual_gid_maps = static:1500
Why is it doing that? Is that another clue that it think raub is a local user due to it being authenticated through pam?
participants (2)
-
Mauricio Tavares
-
Timo Sirainen