Hi all,
I'm trying to setup Per-User quota with LDAP on dovecot 2.4.1
When I try to recalc quota for user, data is retrieved from LDAP server
# doveadm quota recalc -u user
dovecot: auth: Debug: conn unix:/run/auth-userdb (pid=34516,uid=0): Server
accepted connection (fd=20)
dovecot: auth: Debug: master in: USER#0111#011user#011protocol=doveadm
dovecot: auth(user): Debug: : Performing userdb lookup
dovecot: auth(user): Debug: ldap: Performing passdb lookup
dovecot: auth(user): Debug: ldap: pass search: base=ou=user,dc=madrid-ias,dc=eu
scope=subtree filter=(&(objectClass=posixAccount)(uid=user))
fields=uid,homeDirectory,uidNumber,gidNumber,quotaBytes
dovecot: auth(user): Debug: ldap: result: uid=user gidNumber=8 homeDirectory=/
home/users_LDAP/user uidNumber=10017 quotaBytes=32000000
dovecot: auth(user): Debug: ldap: Finished passdb lookup
dovecot: auth(user): Debug: : Finished userdb lookup
dovecot: auth: Debug: userdb out: USER#0111#011user#011home=/home/users_LDAP/
user#011uid=10017#011gid=8#011quota_storage_size=32000000B
dovecot: auth: Debug: conn unix:/run/auth-userdb (pid=34516,uid=0): auth-master
client: Disconnected: Connection closed (fd=20) (created 159 msecs ago,
handshake 159 msecs ago)
Same when an email is delivered:
Debug: master userdb out: USER#0113606183937#011user#011home=/home/users_LDAP/
user#011uid=10017#011gid=8#011quota_storage_size=32000000B#011auth_mech=PLAIN#011auth_token=8a4a9216541654643f33119dd9a280c672c#011local_name=127.0.0.1
But finally the quota limit is still the default value
# doveadm quota get -u user
Quota name Type Value
Limit %
User quota STORAGE 6294796
10485760 60
User quota MESSAGE 29190 -
0
All my dovecot configuration is available below.
About Postfix, dovecot-lda is called with -d option:
mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -d "$USER"
If you have any idea.
Thanks in advance for you help.
Best
Damien
BTW, some "%" seem to be missing in the 2.4 documentation https://
doc.dovecot.org/main/core/plugins/quota.html before {ldap:quotaBytes}B
Dovecot version:
2.4.1-4+ubuntu24.04
dovecot -n:
# OS: Linux 6.8.0-57-generic x86_64 Ubuntu 24.04.2 LTS ext4
# 4 default setting changes since version 2.4.0
dovecot_config_version = 2.4.0
auth_mechanisms = plain login
default_client_limit = 12015
default_process_limit = 3003
default_vsz_limit = 256M
dovecot_storage_version = 2.3.0
fts_autoindex = yes
fts_autoindex_max_recent_msgs = 999
fts_search_add_missing = yes
ldap_base = ou=MyOU,dc=domain,dc=com
ldap_uris = ldap://localhost
log_debug = category=auth
mail_driver = maildir
mail_home = /home/users_LDAP/%{user}/Maildir
mail_path = /home/users_LDAP/%{user}/Maildir
mail_plugins {
quota = yes
}
protocols = imap pop3 sieve
ssl_min_protocol = TLSv1.3
passdb ldap {
fields {
user = %{ldap:uid}
userdb_gid = %{ldap:gidNumber}
userdb_home = %{ldap:homeDirectory}
userdb_quota_storage_size = %{ldap:quotaBytes}B
userdb_uid = %{ldap:uidNumber}
}
bind = yes
filter = (&(objectClass=posixAccount)(uid=%{user}))
}
namespace inbox {
mail_driver = maildir
mail_path = /home/users_LDAP/%{user}/Maildir
hidden = no
inbox = yes
list = yes
prefix =
separator = /
subscriptions = yes
type = private
mailbox Drafts {
special_use = "\\Drafts"
}
mailbox Junk {
special_use = "\\Junk"
}
mailbox Trash {
special_use = "\\Trash"
}
mailbox Sent {
special_use = "\\Sent"
}
mailbox "Sent Messages" {
special_use = "\\Sent"
}
}
service imap-login {
inet_listener imap {
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
}
inet_listener pop3s {
}
}
service submission-login {
inet_listener submission {
}
inet_listener submissions {
}
}
service lmtp {
unix_listener lmtp {
}
}
service imap {
}
service pop3 {
}
service submission {
}
service auth {
unix_listener auth-userdb {
mode = 0777
user = mail
}
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
}
service auth-worker {
}
service dict {
unix_listener dict {
}
}
ssl_server {
cert_file = /etc/letsencrypt/live/cert/fullchain.pem
key_file = /etc/letsencrypt/live/cert/privkey.pem
}
protocol lda {
mail_plugins {
sieve = yes
}
}
protocol imap {
mail_max_userip_connections = 50
mail_plugins {
imap_sieve = yes
imap_quota = yes
}
}
service managesieve-login {
vsz_limit = 64M
inet_listener sieve {
port = 4190
}
inet_listener sieve_deprecated {
port = 2000
}
}
service managesieve {
}
quota "User quota" {
driver = count
storage_size = 10G
quota_warning warn-95 {
quota_storage_percentage = 95
execute quota-warning {
args = 95 %{user}
}
}
quota_warning warn-80 {
quota_storage_percentage = 80
execute quota-warning {
args = 80 %{user}
}
}
}
service quota-warning {
executable = script /usr/local/bin/quota-warning.sh
user = dovecot
unix_listener quota-warning {
user = mail
}
}
sieve_script personal {
active_path = ~/.dovecot.sieve
driver = file
path = ~/sieve
}
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]