Hi,
I am trying to enable per user quotas, but I get the following error:
Feb 18 23:59:20 vmail dovecot: auth(default):
ldap(tester,10.10.100.150): ldap_search((uid=tester)) failed: No such object
It seems as if ldapsearch for username/password won't work with my new
settings, but I can't find why.
I run Dovecot v1.2.11 on CentOS 5.5.
I changed my working dovecot.conf (see later) with the following changes
(I used the roomNumber attribute to store the quota value):
1. Added in main part:
mail_uid = 500
mail_gid = 500
2. Changed userdb with:
userdb ldap {
args = /etc/dovecot-usrdb-ldap.conf
}
and /etc/dovecot-usrdb-ldap.conf is:
hosts = localhost
tls = no
base = ou=people, dc=example, dc=com
scope = subtree
ldap_version = 3
auth_bind = yes
user_filter = (uid=%u)
pass_filter = (uid=%u)
pass_attrs = uid=user,userPassword=password
auth_bind_userdn = uid=%u,ou=people,dc=example,dc=com
user_attrs = roomNumber=quota_rule=*:bytes=%$,uid=home=/home/vmail/%u
3. Changed passdb with
passdb ldap {
args = /etc/dovecot-passdb-ldap.conf
}
where /etc/dovecot-passdb-ldap.conf is identical to dovecot-usrdb-ldap.conf.
What am I doing wrong? Please advise.
Thanks in advance,
Nick
My working dovecot.conf is:
protocols = imap imaps pop3 pop3s
disable_plaintext_auth = no
syslog_facility = local1
ssl = yes
ssl_cert_file = /etc/pki/CA/certs/cert-180.pem
ssl_key_file = /etc/pki/CA/private/key.pem
ssl_ca_file = /etc/pki/CA/certs/cert-180.pem
ssl_verify_client_cert = no
verbose_ssl = no
login_process_size = 64
mail_location = maildir:~/Maildir/
mail_debug = no
protocol imap {
mail_plugins = quota imap_quota
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
mail_max_userip_connections = 3
mail_plugins = quota
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol managesieve {
}
protocol lda {
postmaster_address = postmaster at example.com
mail_plugins = quota
}
auth_username_chars
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
auth_username_format = %Lu
auth_verbose = yes
auth_debug = no
auth default {
mechanisms = plain login
passdb ldap {
args = /etc/dovecot-ldap.conf
}
userdb static {
args = uid=500 gid=500 home=/home/vmail/%u
}
user = root
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
dict {
}
plugin {
quota = maildir:User quota
# Quota limit is 4GB
quota_rule = *:storage=4G
# We add 100Mb more for Trash
quota_rule2 = Trash:storage=100M
# We set up warnings at 75% and 90%
quota_warning = storage=75%% /opt/mail.sh 75 %u
quota_warning2 = storage=90%% /opt/mail.sh 90 %u
}
and dovecot-ldap.conf is:
hosts = localhost
tls = no
base = ou=people, dc=example, dc=com
scope = subtree
ldap_version = 3
auth_bind = yes
pass_attrs = uid=user,userPassword=password
auth_bind_userdn = uid=%u,ou=people,dc=example,dc=com
pass_filter = (uid=%u)
Finally, for reference (dovecot -n):
# 1.2.11: /etc/dovecot.conf
# OS: Linux 2.6.18-194.32.1.el5 x86_64 CentOS release 5.5 (Final)
syslog_facility: local1
ssl_ca_file: /etc/pki/CA/certs/cert-180.pem
ssl_cert_file: /etc/pki/CA/certs/cert-180.pem
ssl_key_file: /etc/pki/CA/private/key.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
mail_max_userip_connections(default): 10
mail_max_userip_connections(imap): 10
mail_max_userip_connections(pop3): 3
mail_location: maildir:~/Maildir/
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib64/dovecot/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
imap_client_workarounds(default): delay-newmail outlook-idle
netscape-eoh
imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
lda:
postmaster_address: postmaster at example.com
mail_plugins: quota
auth default:
mechanisms: plain login
username_format: %Lu
verbose: yes
passdb:
driver: ldap
args: /etc/dovecot-ldap.conf
userdb:
driver: static
args: uid=500 gid=500 home=/home/vmail/%u
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
plugin:
quota: maildir:User quota
quota_rule: *:storage=4G
quota_rule2: Trash:storage=100M
quota_warning: storage=75%% /opt/mail.sh 75 %u
quota_warning2: storage=90%% /opt/mail.sh 90 %u