Quota - Invalid bytes limit

Gonzalo Palacios Goicolea gonzalo.palacios at externo.uam.es
Thu Apr 8 12:37:47 EEST 2021


Hi

Just for if it's helpful for anyone, I have solved the issue modifying 
the quota-warning script. I realized about this log line:

Apr  8 09:34:24 server dovecot: lda(user at domain.es): Debug: Ignoring 
overridden (-o) userdb setting: plugin/quota_rule

So I changed at the script this line

#cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o 
"plugin/quota_rule=*:bytes=%$"

whit this one:

cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER

And now it's working fine.

Best regards

El 25/03/2021 a las 12:30, Gonzalo Palacios Goicolea escribió:
>
> Hi,
>
> More info. At previous version (dovecot-2.2.10-1_14.el6.x86_64) we 
> didn't installed dovecot-pigeonhole, but for this one 
> (dovecot-2.2.36-8.el7.x86_64) it was mandatory or dovecot didn't start 
> because of this error:
>
> "doveconf: Fatal: Error in configuration file 
> /etc/dovecot/dovecot.conf: protocols: Unknown protocol: sieve"
>
> May it be related?
>
> Thanks and best regards
>
> El 22/03/2021 a las 8:47, Gonzalo Palacios Goicolea escribió:
>>
>> Hi
>>
>> Has anyone experienced this issue? I'm not able to debug it.
>>
>> Config, users, permissions, etc are the same as in the previous 
>> version, where it worked without problems.
>>
>> If anyone can help it would be appreciated, I don't know what else look.
>>
>> Thanks and best regards
>>
>> El 16/03/2021 a las 11:40, Gonzalo Palacios Goicolea escribió:
>>>
>>> Hi All,
>>>
>>> Since upgrading to RHEL7 and  we're not able to get quota warnings work.
>>>
>>> We get the error "User initialization failed: Failed to initialize 
>>> quota: Invalid quota root quota: Invalid rule *:bytes=: Invalid 
>>> bytes limit:"
>>>
>>> /mar 16 10:29:27 lda(user at domain): Quota: Executing warning: 
>>> quota-warning 90 user at domain//
>>> //Mar 16 10:29:27 buzonn5 gonzalo: mar 16 10:29:27 lda(user at domain): 
>>> Quota: Executing warning: quota-warning 90 user at domain//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Loading 
>>> modules from directory: /usr/lib64/dovecot//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Module 
>>> loaded: /usr/lib64/dovecot/lib10_quota_plugin.so//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Module 
>>> loaded: /usr/lib64/dovecot/lib15_notify_plugin.so//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Module 
>>> loaded: /usr/lib64/dovecot/lib20_mail_log_plugin.so//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Module 
>>> loaded: /usr/lib64/dovecot/lib90_sieve_plugin.so//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: auth 
>>> USER input: user at domain home=/buzones/externos/4/215283255776546 
>>> uid=508 gid=503 quota_rule=*:bytes=2147483648//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Ignoring 
>>> overridden (-o) userdb setting: plugin/quota_rule//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: 
>>> Effective uid=508, gid=503, home=/buzones/externos/4/215283255776546//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Quota 
>>> root: name=_backup backend=maildir args=ns=//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Debug: Quota 
>>> rule: root=_backup mailbox=* bytes=0 messages=0//
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda(user at domain): Error: User 
>>> initialization failed: Failed to initialize quota: Invalid quota 
>>> root quota: Invalid rule *:bytes=: Invalid bytes limit://
>>> //Mar 16 10:29:27 buzonn5 dovecot: lda: Fatal: Invalid user 
>>> settings. Refer to server log for more information./
>>>
>>> This is the quota-warning script:
>>>
>>>
>>> /#!/bin/sh//
>>> //#Variables//
>>> //PERCENT=$1//
>>> //USER=$2//
>>> //FECHA=`date '+%b %d %H:%M:%S'`//
>>> //
>>> //#Logueo del evento//
>>> //echo "$FECHA lda($USER): Quota: Executing warning: quota-warning 
>>> $PERCENT $USER" >> /var/log/dovecot/dovecot.log//
>>> //logger -p local1.notice -f /var/log/dovecot/dovecot.log "$FECHA 
>>> lda($USER): Quota: Executing warning: quota-warning $PERCENT $USER"//
>>> //
>>> //cat << EOF | /usr/libexec/dovecot/dovecot-lda -d $USER -o 
>>> "plugin/quota_rule=*:bytes=%$"//
>>> //From: postmaster at domain//
>>> //Subject: Alerta de Capacidad//
>>> //Date: `date`//
>>> //
>>> //El espacio asignado para el almacenamiento de su correo ha 
>>> superado el $PERCENT% de su capacidad total. Por ello, se recomienda 
>>> que elimine correos y/o vacie la papelera para liberar espacio.//
>>> //Mensaje enviado desde `hostname`//
>>> //
>>> //Atentamente,//
>>> //
>>> //--//
>>> //Responsable correo //
>>> //postmaster at domain//
>>> //
>>> //EOF//
>>> /
>>> -----------------------------
>>>
>>> This is 90-quota.conf
>>>
>>> /plugin {//
>>> //  quota = maildir:_backup:ns=//
>>> //}//
>>> //
>>> //plugin {//
>>> //  quota_exceeded_message = El espacio asignado para el 
>>> almacenamiento del correo del destinatario ha superado su capacidad 
>>> total. Por ello, el correo que usted intenta enviar no se puede 
>>> entregar al destinatario.//
>>> //  quota_warning = storage=70%% quota-warning 70 %u//
>>> //  quota_warning1 = storage=90%% quota-warning 90 %u//
>>> //  quota_warning2 = storage=95%% quota-warning 95 %u//
>>> //  quota_warning3 = storage=99%% quota-warning 99 %u//
>>> //}//
>>> //
>>> //service quota-warning {//
>>> //  executable = script 
>>> /etc/dovecot/scripts_notification_quota/quota-warning.sh//
>>> //  user = vmail//
>>> //  unix_listener quota-warning {//
>>> //    user = vmail//
>>> //  }//
>>> //}/
>>>
>>> Getting user attibutes and quota with doveadms works right:
>>>
>>> /# doveadm user user at domain//
>>> //field   value//
>>> //uid     508//
>>> //gid     503//
>>> //home    /buzones/externos/4/215283255776546//
>>> //mail maildir:/buzones/externos/4/215283255776546/Maildir//
>>> //quota_rule *:bytes=2147483648//
>>> //# doveadm quota get -u user at domain//
>>> //Quota name Type      Value Limit %//
>>> //_backup    STORAGE 1153093 2097152 54//
>>> //_backup    MESSAGE   44347       - /
>>>
>>> It also works fine with ldapsearch
>>>
>>>
>>> /# ldapsearch -x -D "cn=mail_admin,cn=users,dc=domain,dc=es" -w 
>>> ********** -b "dc=domain,dc=es" -h ldap.host mail=user at domain 
>>> mailquotasize//
>>> //# extended LDIF//
>>> //#//
>>> //# LDAPv3//
>>> //# base <dc=domain,dc=es> with scope subtree//
>>> //# filter: mail=user at domain//
>>> //# requesting: mailquotasize//
>>> //#//
>>> //
>>> //# user at domain, users, domain.es//
>>> //dn: cn=user at domain,cn=users,dc=domain,dc=es//
>>> //mailquotasize: 2147483648/
>>>
>>>
>>> I've been googling but I can't find where the problem may be. Can 
>>> you please help me?
>>>
>>> This is the whole config:
>>>
>>> /doveconf -n//
>>> //# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf//
>>> //# Pigeonhole version 0.4.24 (124e06aa)//
>>> //# OS: Linux 3.10.0-1160.6.1.el7.x86_64 x86_64 Red Hat Enterprise 
>>> Linux Server release 7.9 (Maipo)//
>>> //# Hostname: host.domain//
>>> //auth_cache_negative_ttl = 5 mins//
>>> //auth_cache_size = 500 M//
>>> //auth_cache_ttl = 5 mins//
>>> //auth_failure_delay = 5 secs//
>>> //default_vsz_limit = 1 G//
>>> //disable_plaintext_auth = no//
>>> //hostname = host.domain//
>>> //imap_logout_format = in(bytes read)=%i out(bytes sent)=%o//
>>> //listen = *//
>>> //lock_method = dotlock//
>>> //mail_fsync = always//
>>> //mail_location = maildir:%h/Maildir//
>>> //mail_nfs_index = yes//
>>> //mail_nfs_storage = yes//
>>> //mail_plugins = " quota mail_log notify"//
>>> //managesieve_notify_capability = mailto//
>>> //managesieve_sieve_capability = fileinto reject envelope 
>>> encoded-character vacation subaddress comparator-i;ascii-numeric 
>>> relational regex imap4flags copy include variables body enotify 
>>> environment mailbox date index ihave duplicate mime foreverypart 
>>> extracttext imapflags notify//
>>> //mbox_write_locks = fcntl//
>>> //mmap_disable = yes//
>>> //namespace {//
>>> //  location = maildir:%h/Maildir/_backup//
>>> //  prefix = _backup.//
>>> //  separator = .//
>>> //  type = private//
>>> //}//
>>> //namespace inbox {//
>>> //  inbox = yes//
>>> //  location =//
>>> //  mailbox Drafts {//
>>> //    special_use = \Drafts//
>>> //  }//
>>> //  mailbox Junk {//
>>> //    special_use = \Junk//
>>> //  }//
>>> //  mailbox Sent {//
>>> //    special_use = \Sent//
>>> //  }//
>>> //  mailbox "Sent Messages" {//
>>> //    special_use = \Sent//
>>> //  }//
>>> //  mailbox Trash {//
>>> //    special_use = \Trash//
>>> //  }//
>>> //  prefix =//
>>> //}//
>>> //passdb {//
>>> //  args = /etc/dovecot/dovecot-ldap.conf.ext//
>>> //  driver = ldap//
>>> //}//
>>> //plugin {//
>>> //  mail_log_events = delete undelete expunge mailbox_delete 
>>> mailbox_rename mailbox_create save//
>>> //  mail_log_fields = uid box msgid from subject//
>>> //  quota = maildir:_backup:ns=//
>>> //  quota_exceeded_message = El espacio asignado para el 
>>> almacenamiento del correo del destinatario ha superado su capacidad 
>>> total. Por ello, el correo que usted intenta enviar no se puede 
>>> entregar al destinatario.//
>>> //  quota_warning = storage=70%% quota-warning 70 %u//
>>> //  quota_warning1 = storage=90%% quota-warning 90 %u//
>>> //  quota_warning2 = storage=95%% quota-warning 95 %u//
>>> //  quota_warning3 = storage=99%% quota-warning 99 %u//
>>> //  sieve = ~/.dovecot.sieve//
>>> //  sieve_dir = ~/Maildir/sieve//
>>> //  sieve_extensions = +notify +imapflags//
>>> //}//
>>> //postmaster_address = postmaster at domain//
>>> //protocols = imap pop3 sieve//
>>> //service auth {//
>>> //  unix_listener auth-userdb {//
>>> //    group = vmail//
>>> //    mode = 0777//
>>> //    user = vmail//
>>> //  }//
>>> //}//
>>> //service imap-login {//
>>> //  inet_listener imap {//
>>> //    port = 143//
>>> //  }//
>>> //  process_min_avail = 20//
>>> //}//
>>> //service imap {//
>>> //  process_limit = 2048//
>>> //}//
>>> //service managesieve-login {//
>>> //  inet_listener sieve {//
>>> //    port = 4190//
>>> //  }//
>>> //  inet_listener sieve_deprecated {//
>>> //    port = 2000//
>>> //  }//
>>> //  process_min_avail = 20//
>>> //}//
>>> //service pop3-login {//
>>> //  inet_listener pop3 {//
>>> //    port = 110//
>>> //  }//
>>> //  process_min_avail = 20//
>>> //}//
>>> //service pop3 {//
>>> //  process_limit = 2048//
>>> //}//
>>> //service quota-warning {//
>>> //  executable = script 
>>> /etc/dovecot/scripts_notification_quota/quota-warning.sh//
>>> //  unix_listener quota-warning {//
>>> //    user = vmail//
>>> //  }//
>>> //  user = vmail//
>>> //}//
>>> //ssl = no//
>>> //ssl_cert = </etc/pki/dovecot/certs/dovecot.pem//
>>> //ssl_key =  # hidden, use -P to show it//
>>> //submission_host = smtpi.domain:25//
>>> //syslog_facility = local1//
>>> //userdb {//
>>> //  args = /etc/dovecot/dovecot-ldap.conf.ext//
>>> //  driver = ldap//
>>> //}//
>>> //protocol lda {//
>>> //  mail_plugins = " quota mail_log notify sieve"//
>>> //}//
>>> //protocol imap {//
>>> //  mail_max_userip_connections = 10000//
>>> //  mail_plugins = " quota mail_log notify imap_quota"//
>>> //}//
>>> //protocol pop3 {//
>>> //  mail_max_userip_connections = 10//
>>> //}/
>>>
>>>
>>> Thanks and best regards
>>>
>>> -- 
>>>
>>> *Gonzalo Palacios Goicolea*
>>> U.T de Infraestructura de Equipos Centrales
>>> /Tecnologías de la Información/
>>> Universidad Autónoma de Madrid • Campus de Cantoblanco
>>> Antes de imprimir este correo piense si es necesario.Cuidemos el 
>>> medioambiente.
>>>
>> -- 
>>
>> *Gonzalo Palacios Goicolea*
>> U.T de Infraestructura de Equipos Centrales
>> /Tecnologías de la Información/
>> Universidad Autónoma de Madrid • Campus de Cantoblanco
>> Antes de imprimir este correo piense si es necesario.Cuidemos el 
>> medioambiente.
>>
> -- 
>
> *Gonzalo Palacios Goicolea*
> U.T de Infraestructura de Equipos Centrales
> /Tecnologías de la Información/
> Universidad Autónoma de Madrid • Campus de Cantoblanco
> Antes de imprimir este correo piense si es necesario.Cuidemos el 
> medioambiente.
>
-- 

*Gonzalo Palacios Goicolea*
U.T de Infraestructura de Equipos Centrales
/Tecnologías de la Información/
Universidad Autónoma de Madrid • Campus de Cantoblanco
<3D"http://www.uam.es/">

Antes de imprimir este correo piense si es necesario.Cuidemos el 
medioambiente.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20210408/39de1f27/attachment-0001.html>


More information about the dovecot mailing list