Timo Sirainen <tss at iki.fi> writes:
> On Sat, 2008-04-12 at 17:28 +0200, Anders wrote:
>> I am trying to use a master user. The login works. However, a LIST
>> command gives me only the INBOX. Is this to be expected? When logging
in
>> normally, I do get the full list of folders.
>
> Your configuration is somehow wrong then. Set mail_debug=yes and look at
> the logs to see where Dovecot is trying to find the mails from. If that
> doesn't help, post the log, your dovecot -n output and other relevant
> configs.
It logs the correct value for "home" with mail_debug=yes. It is also
able to print the correct quota values, so Dovecot seems to end up at
the right place.
My test PHP program is here:
echo '<?
$mbox=imap_open("{localhost:143/notls}","am*master","masterpw",
OP_HALFOPEN);
print_r(imap_list($mbox,"{localhost:143}","*"));
print_r(imap_get_quota($mbox,""));?>'|php -qC
The log looks like this (with domain changed to example.invalid):
Apr 18 20:50:18 mail dovecot: auth(default): client in: AUTH 1 LOGIN
service=imap secured lip=127.0.0.1 rip=127.0.0.1 lport=143
rport=44735
Apr 18 20:50:18 mail dovecot: auth(default): client out: CONT 1
VXNlcm5hbWU6
Apr 18 20:50:18 mail dovecot: auth(default): client in: CONT<hidden>
Apr 18 20:50:18 mail dovecot: auth(default): client out: CONT 1
UGFzc3dvcmQ6
Apr 18 20:50:18 mail dovecot: auth(default): client in: CONT<hidden>
Apr 18 20:50:18 mail dovecot: auth(default):
passwd-file(master,127.0.0.1,master): lookup: user=master
file=/usr/local/dovecot/etc/passwd.masterusers
Apr 18 20:50:18 mail dovecot: auth(default): passdb(master,127.0.0.1,master):
Master user logging in as am
Apr 18 20:50:18 mail dovecot: auth(default): ldap(am,127.0.0.1): pass search:
base=dc=example, dc=invalid scope=subtree
filter=(&(objectClass=gosaMailAccount)(|(mail=am)(uid=am)))
fields=mail,userPassword
Apr 18 20:50:18 mail dovecot: auth(default): auth(am,127.0.0.1): username
changed am -> am at example.invalid
Apr 18 20:50:18 mail dovecot: auth(default): ldap(am at
example.invalid,127.0.0.1): result: mail(user)=am at example.invalid
userPassword(password)=<hidden>
Apr 18 20:50:18 mail dovecot: auth(default): client out: OK 1 user=am
at example.invalid
Apr 18 20:50:18 mail dovecot: auth(default): master in: REQUEST 5 6644
1
Apr 18 20:50:18 mail dovecot: auth(default): ldap(am at
example.invalid,127.0.0.1): user search: base=dc=example, dc=invalid
scope=subtree filter=(&(objectClass=gosaMailAccount)(mail=am at
example.invalid)) fields=mail,uid,gosaMailQuota
Apr 18 20:50:18 mail dovecot: auth(default): ldap(am at
example.invalid,127.0.0.1): result:
uid(home=/var/mail/vhosts/%d/%n)=/var/mail/vhosts/example.invalid/am
mail(sieve_dir=/var/mail/vhosts/%d/%n/sieve)=/var/mail/vhosts/example.invalid/am/sieve
gosaMailQuota(quota_rule=*:bytes=%$M)=*:bytes=100M
Apr 18 20:50:18 mail dovecot: auth(default): master out: USER 5 am at
example.invalid home=/var/mail/vhosts/example.invalid/am
sieve_dir=/var/mail/vhosts/example.invalid/am/sieve quota_rule=*:bytes=100M
master_user=master
Apr 18 20:50:18 mail dovecot: imap-login: Login: user=<am at
example.invalid>, method=LOGIN, rip=127.0.0.1, lip=127.0.0.1, secured
Apr 18 20:50:18 mail dovecot: IMAP(am at example.invalid): Disconnected: Logged
out bytes=78/379
Apr 18 20:50:19 mail dovecot: auth(default): new auth connection: pid=6815
My LDAP config is this:
user_attrs =
mail=sieve_dir=/var/mail/vhosts/%d/%n/sieve,uid=home=/var/mail/vhosts/%d/%n,gosaMailQuota=quota_rule=*:bytes=%$M
user_filter = (&(objectClass=gosaMailAccount)(mail=%u))
pass_attrs = mail=user,userPassword=password
pass_filter = (&(objectClass=gosaMailAccount)(|(mail=%u)(uid=%u)))
And here is dovecot -n output:
# 1.1.rc4: /usr/local/dovecot-1.1rc4/etc/dovecot.conf
protocols: imap imaps managesieve
listen(default): 127.0.0.1
listen(imap): 127.0.0.1
listen(managesieve): *
ssl_listen(default): *
ssl_listen(imap): *
ssl_listen(managesieve):
ssl_cert_file: /etc/ssl/private/dovecot.pem
disable_plaintext_auth: no
login_dir: /usr/local/dovecot-1.1rc4/var/run/dovecot/login
login_executable(default): /usr/local/dovecot-1.1rc4/libexec/dovecot/imap-login
login_executable(imap): /usr/local/dovecot-1.1rc4/libexec/dovecot/imap-login
login_executable(managesieve):
/usr/local/dovecot-1.1rc4/libexec/dovecot/managesieve-login
login_user: doveauth
valid_chroot_dirs: /var/mail/vhosts
mail_uid: vmail
mail_gid: vmail
mail_location: maildir:~/Maildir
mail_executable(default): /usr/local/dovecot-1.1rc4/libexec/dovecot/imap
mail_executable(imap): /usr/local/dovecot-1.1rc4/libexec/dovecot/imap
mail_executable(managesieve):
/usr/local/dovecot-1.1rc4/libexec/dovecot/managesieve
mail_plugins(default): acl quota expire imap_quota mail_log
mail_plugins(imap): acl quota expire imap_quota mail_log
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/local/dovecot-1.1rc4/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/dovecot-1.1rc4/lib/dovecot/imap
mail_plugin_dir(managesieve): /usr/local/dovecot-1.1rc4/lib/dovecot/managesieve
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(managesieve):
sieve_storage(default):
sieve_storage(imap):
sieve_storage(managesieve): ~/sieve
sieve(default):
sieve(imap):
sieve(managesieve): ~/.dovecot.sieve-not
auth default:
mechanisms: plain login
user: dovecot
master_user_separator: *
debug: yes
passdb:
driver: passwd-file
args: /usr/local/dovecot/etc/passwd.masterusers
pass: yes
master: yes
passdb:
driver: ldap
args: /usr/local/dovecot/etc/dovecot-ldap.conf
userdb:
driver: ldap
args: /usr/local/dovecot/etc/dovecot-ldap.conf
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
master:
path: /usr/local/dovecot/var/run/dovecot/auth-master
mode: 384
user: vmail
group: vmail
plugin:
quota: maildir
quota_rule: *:bytes=0
quota_warning: storage=95%% /usr/local/bin/quota-warning 95
quota_warning2: storage=80%% /usr/local/bin/quota-warning 80
acl: vfile:/etc/dovecot-acls:cache_secs=300
expire: backup 30 spam 3
expire_dict: proxy::expire
dict:
expire: db:/usr/local/dovecot/var/expire.db