[Dovecot] [DOVECOT] quota_warning threshold from ldap

Emmanuel Gonzalez egonzalez at babel.it
Thu Sep 10 18:42:59 EEST 2009


Hello all,
I'm trying to get dovecot read three different quota_warnings values 
directly from ldap. I configured correctly the quota_rule value, know 
I'm trying to override this values:

quota_warning  = storage=95%% /usr/local/bin/quota-warning.sh 95
quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
quota_warning3 = storage=70%% /usr/local/bin/quota-warning.sh 70

reading the values 95, 80 and 70 from ldap.

I tried to do this in my dovecot-ldap.conf

user_attrs = 
mailMessageStore=mail=maildir:/maildirs/%$,maildirquota=quota_rule=*:backend, 
*maildirwarn1*=quota_warning = storage=*maildirwarn1%% 
*/usr/local/bin/quota-warning.sh *maildirwarn1%%*

I'm sure that I'm doing something wrong. Any ideas?

This is my configuration:

# dovecot --version
1.2.4

# dovecot -n                              
# 1.2.4: /etc/dovecot.conf                                           
# OS: Linux 2.6.18-128.7.1.el5PAE i686 CentOS release 5.3 (Final)    
log_path: /var/log/dovecot-deliver.log                               
info_log_path: /var/log/dovecot-deliver.log                          
log_timestamp: %Y-%m-%d %H:%M:%S                                     
listen(default): localhost:143                                       
listen(imap): localhost:143                                          
listen(pop3): *, [::]                                                
ssl: no                                                              
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              
first_valid_uid: 8                                                   
first_valid_gid: 12                                                  
mail_privileged_group: mail                                          
mail_uid: 8                                                          
mail_gid: 12                                                         
mail_location: maildir:~/Maildir                                     
mail_debug: yes                                                      
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 acl imap_acl                 
mail_plugins(imap): quota imap_quota acl imap_acl                    
mail_plugins(pop3):                                                  
mail_plugin_dir(default): /usr/lib/dovecot/imap                      
mail_plugin_dir(imap): /usr/lib/dovecot/imap                         
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3                         
namespace:                                                           
  type: private                                                      
  separator: /                                                       
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: shared/%%u/
  location: maildir:/maildirs/%%d/%%u/Maildir
  list: children
lda:
  postmaster_address: postmaster at mydomain.it
  mail_plugins: quota
  log_debug: /var/log/dovecot-deliver.log
  auth_socket_path: /var/run/dovecot/auth-master
auth default:
  default_realm: mydomain.it
  verbose: yes
  debug: yes
  passdb:
    driver: ldap
    args: /etc/dovecot-ldap.conf
  userdb:
    driver: passwd
  userdb:
    driver: ldap
    args: /etc/dovecot-ldap.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: mail
      group: mail
plugin:
  quota: maildir
  acl: vfile
  acl_shared_dict: file:/maildirs/shared-mailboxes

# grep -v '^ *\(#.*\)\?$' /etc/dovecot-ldap.conf
hosts = localhost
sasl_bind = no
auth_bind = yes
ldap_version = 3
base = dc=mydomain,dc=it
scope = subtree
user_attrs = 
mailMessageStore=mail=maildir:/maildirs/%$,maildirquota=quota_rule=*:backend
user_filter = (&(objectClass=inetOrgPerson)(mail=%u))
pass_attrs = mail=user,userPassword=password,mailMessageStore=userdb_home
pass_filter = (&(objectClass=inetOrgPerson)(mail=%u))

Some important values from my ldap

# /usr/lib/mozldap/ldapsearch -h localhost -D "cn=Directory Manager" -w 
XXXXXXXX  -b "dc=mydomain,dc=it" "mail=user at mydomain.it"
version: 
1                                                                                                                                                    

dn: uid=user,ou=People,dc=mydomain.it,dc=mydomain,dc=it
givenName: user
mailProgramDeliveryInfo: /maildirs/
vacationMessage: Modificare questo messaggio
mailMessageStore: mydomain.it/user at mydomain.it/Maildir/
uid: user
mail: user at mydomain.it
cn: user
sn: user
*maildirQuota: 51200S*
*maildirwarn1: 70
maildirwarn2: 80
maildirwarn3: 90*
mailHost: localhost
mailmaxmessagesize: 10485760



More information about the dovecot mailing list