<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font face="Helvetica, Arial, sans-serif">Hi,<br>
      sorry to bother you.. any idea ? how to give more space to a
      specific user ?<br>
      And where to place the line, in order to overide the general rule
      ?<br>
      <br>
      I suspect that to increase the space for the specific user AZT000,
      that should be : quota_rule=azt000:storage=160gb.. but where<br>
      <br>
      Thanks and regards,<br>
    </font><br>
    <div class="moz-cite-prefix">Le 06/10/2021 à 15:49, Stephane Magnier
      a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:d0d2fbae-52ba-1320-61b9-aa987cfaba80@netcourrier.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <font face="Helvetica, Arial, sans-serif">not exactly..<br>
        <br>
        Usernames are :  azt000, azt001, azt002, etc.....<br>
        All of them have their mailbox in  /var/spool2/mail/azt000, </font><font
        face="Helvetica, Arial, sans-serif"><font face="Helvetica,
          Arial, sans-serif">/var/spool2/mail/azt001</font>  )<br>
        <br>
        Everybody will get 30Gb by default<br>
        Except the user <b>azt000</b>, who will have 160Gb<br>
        <br>
        So, I understand, that the general rule is this<br>
        <br>
      </font><br>
      <pre class="moz-quote-pre" wrap="">plugin {
 quota = maildir:User quota
 quota_rule = *:storage=30GB
 quota_rule2 = Trash:storage=+100MB
 quota_rule3 = Spam:storage=+20%%</pre>
      <font face="Helvetica, Arial, sans-serif">}<br>
        <br>
        <br>
        Now, I suppose , to specify the user <b>azt000 and only this
          one</b>, to get a quota of 160Gb, I should write something
        like:  <b>quota_rule=azt000:storage=+160Gb  </b>correct ?<b><br>
        </b><br>
        but where !<br>
        <br>
        1) If I had this sentence into<u> the plugin</u> ( as it was
        before ) , it's not considered. Every body stays with the
        general 30Gb allocated in my example<br>
        2) My understanding is, according to the link you sent to me, I
        have to write this specific condition  :<b> </b></font><font
        face="Helvetica, Arial, sans-serif"><font face="Helvetica,
          Arial, sans-serif"><b>quota_rule=azt000:storage=+160Gb</b><br>
          <u>Outside</u> the plugin.. I've made different tests and all
          of them are not working.. The Dovecot doesn't start<br>
          <br>
          I also tried this<br>
        </font></font>
      <blockquote><font face="Helvetica, Arial, sans-serif"><font
            face="Helvetica, Arial, sans-serif">userdb {</font></font><br>
        <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
            Arial, sans-serif">   driver = passwd</font></font><br>
        <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
            Arial, sans-serif">  args = /etc/dovecot/quota-overrides</font></font><br>
        <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
            Arial, sans-serif">  <font color="#ff0000">quota_rule=azt000:storage=+160Gb</font></font></font><br>
        <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
            Arial, sans-serif">   result_success=continue-ok</font></font><br>
        <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
            Arial, sans-serif"> }</font></font><br>
      </blockquote>
      <font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
          Arial, sans-serif">I would like to keep 30gb for any user
          AZTxxx, But for some specific users ( like AZT000), I wish to
          adapt the quota limit<br>
          <br>
          sorry to bother with that. I hope not to be too much pain in
          the neck..:-)<br>
          Thanks !!<br>
          <b><br>
          </b></font></font>
      <div class="moz-cite-prefix">Le 06/10/2021 à 14:51, Aki Tuomi a
        écrit :<br>
      </div>
      <blockquote type="cite"
cite="mid:724885717.7626.1633524697153@appsuite-dev-gw1.open-xchange.com">
        <pre class="moz-quote-pre" wrap="">No. The syntax is not correct. 

<a class="moz-txt-link-freetext" href="https://doc.dovecot.org/configuration_manual/quota/#quota-rules" moz-do-not-send="true">https://doc.dovecot.org/configuration_manual/quota/#quota-rules</a>

this says that the rule is:

quota_rule = <mailbox name>:<limit configuration>

so unless you want 160GB quota for mailbox folder `azt000` (not username), you want to use * here.

Aki

</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">On 06/10/2021 15:36 Stephane Magnier <a class="moz-txt-link-rfc2396E" href="mailto:steph.mag220@netcourrier.com" moz-do-not-send="true"><steph.mag220@netcourrier.com></a> wrote:


OK, but is the syntax correct ?
 
 Should it be :azt000:quota_rule4=+160GB ?
Is that correct ?
 
Because I've made the test.. It didn't "shoot at me" while restarting the service, it apparently accept the syntax, but the result is still wrong.. 
 It is still considering a limit of 30gb and not 160Gb
 ( the line : quota_rule = *:storage=30GB ) 
 
 To sum up , I have 
 

</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">plugin {
 quota = maildir:User quota
 quota_rule = *:storage=30GB
 quota_rule2 = Trash:storage=+100MB
 quota_rule3 = Spam:storage=+20%%
 azt000:quota_rule4=+160GB
 
 
 quota_status_success = DUNNO
 quota_status_nouser = DUNNO
 quota_status_overquota = "552 5.2.2 Mailbox is full"
 quota_warning = storage=95%% quota-warning 95 %u
 quota_warning2 = storage=80%% quota-warning 80 %u
 quota_warning3 = storage=100%% quota-warning below %u
 quota_grace = 10%%
 
 # Quota plugin can also limit the maximum accepted mail size.
 quota_max_mail_size = 100M
 }

</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">and 
 

</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">userdb {
 driver = passwd
 args = /etc/dovecot/quota-overrides
 result_success=continue-ok
 }

</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">but 
 

</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">[root@mbox1 conf.d]# service dovecot restart
 Redirecting to /bin/systemctl restart dovecot.service
 [root@mbox1 conf.d]# doveadm quota get -u azt000
 Quota name Type Value Limit %
 User quota STORAGE 22268406 31457280 70
 User quota MESSAGE 29853 - 0
 [root@mbox1 conf.d]#

</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap=""> 
 With 70% ; it's considering the 30Gb and not the 160Gb ( the AZT000 folder size is about 21Gb )
 
 

Le 06/10/2021 à 14:08, Aki Tuomi a écrit :

</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">The rules must be consecutive,

if your global config has

quota_rule1
quota_rule2

then the userdb must return

quota_rule3. Or it will overwrite an existing rule.

Aki



</pre>
            <blockquote type="cite">
              <pre class="moz-quote-pre" wrap="">On 06/10/2021 13:07 Stephane Magnier <a class="moz-txt-link-rfc2396E" href="mailto:steph.mag220@netcourrier.com" moz-do-not-send="true"><steph.mag220@netcourrier.com></a> wrote:


Hi,
 
 OK, I wrote this :
 


</pre>
              <blockquote type="cite">
                <pre class="moz-quote-pre" wrap="">userdb {
 driver = passwd
 args = /etc/dovecot/quota-overrides
 
 result_success=continue-ok
 
 # Override fields from passwd
 #override_fields = home=/home/virtual/%u
 }


</pre>
              </blockquote>
              <pre class="moz-quote-pre" wrap=""> but sorry I don't understand the following line 

 username::::::::::quota_ruleX=... where X is the next rule number.

 What should I write ?...... for instance :  ? something like that ??
 
 
 
 
 Le 06/10/2021 à 10:13, Aki Tuomi a écrit :


</pre>
              <blockquote type="cite">
                <pre class="moz-quote-pre" wrap="">That `*` there is actually mailbox mask. You have to return an additional quota_ruleN from your userdb for that user.

You can do e.g.

userdb {
   ..
   result_success=continue-ok}
}

userdb {
   driver = passwd
   args = /etc/dovecot/quota-overrides
}

and put in there 

username::::::::::quota_ruleX=... where X is the next rule number.

the count of : might be wrong.

Aki



</pre>
                <blockquote type="cite">
                  <pre class="moz-quote-pre" wrap="">On 06/10/2021 10:43 Stephane Magnier <a class="moz-txt-link-rfc2396E" href="mailto:steph.mag220@netcourrier.com" moz-do-not-send="true"><steph.mag220@netcourrier.com></a> wrote:


Hi Again,
 
 Juste another one...
 
 The quota I've decided is 30Gb for everybody
 I would like to add an exception for the user AZT000 so here is my test :
 
 I put 60 GB for AZT000, but apparently, this is not seen :-( No error message
 Is there a general syntax for a specific user ?
 
 NB: I tried :
 quota_rule = azt000:storage=+60GB orquota_rule1 = azt000:storage=+60GB same results
 
 



</pre>
                  <blockquote type="cite">
                    <pre class="moz-quote-pre" wrap="">plugin {
 quota = maildir:User quota
 quota_rule = *:storage=30GB
 quota_rule2 = Trash:storage=+100MB
 quota_rule3 = Spam:storage=+20%%
 # quota_rule = *:storage=70GB
 # quota_rule = *:storage=70GB
 quota_rule = azt000:storage=+60GB



</pre>
                  </blockquote>
                  <pre class="moz-quote-pre" wrap="">Le 06/10/2021 à 08:09, Stephane Magnier a écrit :



</pre>
                  <blockquote type="cite">
                    <pre class="moz-quote-pre" wrap="">Great !! works fine.. 
 
 I had in fact, twice the same déclaration of quotat and storage on the same file..... one of them was with an upper case "S" for Storage..

 Thanks again
 

Le 06/10/2021 à 07:50, Aki Tuomi a écrit :



</pre>
                    <blockquote type="cite">
                      <blockquote type="cite">
                        <pre class="moz-quote-pre" wrap="">On 06/10/2021 08:38 Stephane Magnier <a class="moz-txt-link-rfc2396E" href="mailto:steph.mag220@netcourrier.com" moz-do-not-send="true"><steph.mag220@netcourrier.com></a> wrote:



 

Le 06/10/2021 à 06:51, Aki Tuomi a écrit :




</pre>
                        <blockquote type="cite">
                          <blockquote type="cite">
                            <pre class="moz-quote-pre" wrap="">On 06/10/2021 07:30 Stephane Magnier <a class="moz-txt-link-rfc2396E" href="mailto:steph.mag220@netcourrier.com" moz-do-not-send="true"><steph.mag220@netcourrier.com></a> wrote:



 

Le 06/10/2021 à 06:10, Stephane Magnier a écrit :





</pre>
                            <blockquote type="cite">
                              <pre class="moz-quote-pre" wrap="">Hi,
 I am just running Dovecot v 2.3.8 .. seems to work fine.
 I just add the quota plugin.. and.. I cannot see any differences.. I cannot see any information on Quota per user.. No specific info on Log file :-(
 
 Any help please ?
 
 Tahnks for your help
 
 Here is my config :
 

# 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.8 (b7b03ba2)
# OS: Linux 4.18.0-305.12.1.el8_4.x86_64 x86_64 CentOS Linux release 8.4.2105 nfs4
# Hostname: mbox1.intranet.office.itx
auth_cache_negative_ttl = 5 mins
auth_cache_ttl = 5 mins
auth_mechanisms = plain login
auth_username_format = %u
debug_log_path = /var/log/dovecot-debug.log
default_vsz_limit = 4 G
info_log_path = /var/log/dovecot-info.log
listen = * [::]
log_path = /var/log/dovecot.log
login_trusted_networks = 172.18.0.0/16 127.0.0.1 ::1
mail_access_groups = dovecot
mail_fsync = always
mail_location = maildir:/var/spool2/mail/%u:LAYOUT=fs
mail_nfs_storage = yes
mail_plugins = " quota"
mail_privileged_group = mail
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 ihave
mbox_very_dirty_syncs = yes
mbox_write_locks = fcntl
mmap_disable = yes
namespace inbox {
  disabled = no
  ignore_on_failure = no
  inbox = yes
  list = yes
  location = 
  mailbox Archive {
    auto = no
    comment = " All my Accepted/NON  SPAM"
    special_use = \Archive
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    autoexpunge = 90 days
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Trash {
    auto = no
    autoexpunge = 60 days
    special_use = \Trash
  }
  mailbox virtual/All {
    auto = no
    special_use = \All
  }
  prefix = 
  subscriptions = yes
  type = private
}
passdb {
  driver = pam
}
plugin {
  quota_grace = 10%%
  quota_max_mail_size = 100M
  quota_rule = *:storage=10000M
  quota_rule2 = Trash:Storage=+100M
  quota_rule3 = Spam:storage=+20%%
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  quota_warning3 = -storage=100%% quota-warning below %u
  sieve = <a class="moz-txt-link-freetext" href="file:~/sieve;active=~/.dovecot.sieve" moz-do-not-send="true">file:~/sieve;active=~/.dovecot.sieve</a>
}
pop3_uidl_format = %v-%u
service auth {
  unix_listener auth-master {
    mode = 0666
  }
  unix_listener auth-userdb {
    mode = 0600
    user = mail
  }
}
service dict {
  unix_listener dict {
    mode = 0600
    user = mail
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
  process_min_avail = 4
  service_count = 0
}
service lmtp {
  inet_listener lmtp {
    port = 24
  }
  unix_listener /var/run/lmtp {
    group = mail
    mode = 0660
    user = mail
  }
}
service pop3-login {
  inet_listener pop3 {
    address = *
    port = 110
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    user = mail
  }
  user = dovecot
}
service submission {
  process_limit = 250
}
ssl = required
ssl_ca = </etc/mail/ssl/ssl1/xxxxxp_net.ca-bundle
ssl_cert = </etc/mail/ssl/ssl1/xxxxxx_net.crt
ssl_cipher_list = HIGH:!aNULL:!ADH:!DH:!RC4:!MD5:!RSA
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}
verbose_proctitle = yes
protocol lmtp {
  mail_fsync = optimized
  mail_plugins = autocreate quota acl fts fts_solr zlib mail_log notify sieve
  postmaster_address = <a class="moz-txt-link-abbreviated" href="mailto:it@intranet.office.itx" moz-do-not-send="true">it@intranet.office.itx</a>
}
protocol lda {
  mail_fsync = optimized
  mail_plugins = " quota sieve quota"
}
protocol imap {
  mail_max_userip_connections = 80
  mail_plugins = " quota quota imap_quota"
  ssl_cert = </etc/mail/ssl/ssl1/STAR_aztgrp_net.crt
  ssl_key = # hidden, use -P to show it
}
protocol pop3 {
  mail_max_userip_connections = 10
  mail_plugins = " quota"
}
protocol submission {
  mail_max_userip_connections = 10
  mail_plugins = " quota"
}






</pre>
                            </blockquote>
                            <pre class="moz-quote-pre" wrap=""> Just for info
 
 [root@mbox1 xenia]# doveadm quota get -A |grep "STORAGE"
 Nothing at all ?? weird
 [root@mbox1 xenia]#
 
 [root@mbox1 xenia]# doveadm quota get -u <user1>
 Quota name Type Value Limit %
 [root@mbox1 xenia]#
 => Absolutely nothing is displayed ????
 
 
 normally, the size of the user1 email folder is about 21 Gb
 So..just modified the line :quota_rule = *:storage=100G
 But nothing has changed...






</pre>
                          </blockquote>
                          <pre class="moz-quote-pre" wrap="">You are missing quota driver settings, the recommended settings are

plugin {
 quota = count
 quota_vsizes = yes
}

Aki




</pre>
                        </blockquote>
                        <pre class="moz-quote-pre" wrap=""> Hi Aki,
 Thanks for your reply..
 
 I just tryed to ad it.. but this can't connect anymore .
 Here is my exact declaration "90-quota.conf"
 
 ( based on : <a class="moz-txt-link-freetext" href="https://doc.dovecot.org/configuration_manual/quota/" moz-do-not-send="true">https://doc.dovecot.org/configuration_manual/quota/</a> )




</pre>
                        <blockquote type="cite">
                          <pre class="moz-quote-pre" wrap="">plugin {
 quota = count
 quota_vsizes = yes
 #quota = maildir:User quota
 quota_rule = *:storage=100GB
 # quota_rule2 = Trash:storage=+100MB
 # quota_rule3 = Spam:storage=+20%%
 # 20% of 100GB = 20GB
 quota_status_success = DUNNO
 quota_status_nouser = DUNNO
 quota_status_overquota = "552 5.2.2 Mailbox is full"
 quota_warning = storage=95%% quota-warning 95 %u
 quota_warning2 = storage=80%% quota-warning 80 %u
 quota_warning3 = -storage=100%% quota-warning below %u
 
 # LDA/LMTP allows saving the last mail to bring user from under quota to
 # over quota, if the quota doesn't grow too high. Default is to allow as
 # long as quota will stay under 10% above the limit. Also allowed e.g. 10M.
 quota_grace = 10%%
 
 # Quota plugin can also limit the maximum accepted mail size.
 quota_max_mail_size = 100M
 }




</pre>
                        </blockquote>
                        <pre class="moz-quote-pre" wrap=""> 
 The error message I have now is :
 
 Oct 06 07:23:35 imap(azt000)<7381><3pAIWajNgdcgAUHQ/kJ8Aikr1PIAQmFL>: Error: Failed to initialize quota: Invalid quota root quota: Invalid rule Trash:Storage=+100M: Unknown rule limit name: Storage
 Oct 06 07:23:35 imap(azt000)<7382><jqwJWajNgtcgAUHQ/kJ8Aikr1PIAQmFL>: Error: Failed to initialize quota: Invalid quota root quota: Invalid rule Trash:Storage=+100M: Unknown rule limit name: Storage
 Oct 06 07:26:02 master: Warning: Killed with signal 15 (by pid=8420 uid=0 code=kill)
 Oct 06 07:26:10 imap(azt000)<8468><cDRLYqjNcsSsEgA3>: Error: Failed to initialize quota: Invalid quota root quota: Invalid rule Trash:Storage=+100M: Unknown rule limit name: Storage
 Oct 06 07:26:13 imap(azt000)<8469><mxN6YqjNdMSsEgA3>: Error: Failed to initialize quota: Invalid quota root quota: Invalid rule Trash:Storage=+100M: Unknown rule limit name: Storage

 Then you can see that I've removed the 2 lines 
 # quota_rule2 = Trash:storage=+100MB
 # quota_rule3 = Spam:storage=+20%%
 
 but without any success
 
 Effectively.. what is the Word "Storage" for Dovecot ?? no idea ... I just wrote what I saw :-)
 
 For info : all the mailbox are placed on a NFS storage.. Don't know if this help to locate the problem..
 Thanks and regards,
 
 
 




</pre>
                      </blockquote>
                      <pre class="moz-quote-pre" wrap="">Did you try changing Storage => storage in your rule? It seems to be coming either from userdb or your config.

Try `doveadm user azt000` to if your userdb is providing these rules.

Aki



</pre>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>