Dovecot2 Quota Issues

  • Sarge888

    Sarge888 - 2012-10-07

    Iv tried looking around to find a fix but iv been unsuccessful. Im not sure how to explain this so il do the best i can. my apologies ahead of time if its not fully understandable.

    Iv setup quotas per wiki2 instructions and postfixadmins. i can set quotas for domains and mailboxes but they do not seem to carry over to the database. the quotas under database tables "domain" & "mailbox" do show the set quotas correctly under column "Quota". however the database table "Quota2" doesnt have any data added to it.
    also running

    doveadm quota -u

    shows the following

    Quota name                                         Type               Value            Limit     %
    storage=1024000                          STORAGE            20                  -          0

    The only thing that changes is the value of the following


    Im guessing its just updating the wrong value or something. Hopefully someone can help me with this.

  • Sarge888

    Sarge888 - 2012-10-07

    I cant edit this to change the formatting to better show but you should get the idea… Also i dont know what .conf file to show as i dont know what pertains to this. Il guess the following.


    driver = mysql
    connect = host=localhost dbname=NAME user=USER password=PASS
    # The new name for MD5 is MD5-CRYPT so you might need to change this depending on version
    default_pass_scheme = MD5
    # Get the mailbox
    user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 101 AS uid, 12 AS gid, concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
    # Get the password
    password_query = SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, 'maildir:/var/vmail/%d/%n' as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
    # If using client certificates for authentication, comment the above and uncomment the following
    #password_query = SELECT null AS password, '%u' AS user
    iterate_query = SELECT username AS user FROM mailbox


    connect = host=localhost dbname=NAME user=USER password=PASS
    map {
      pattern = priv/quota/storage
      table = quota2
      username_field = username
      value_field = bytes
    map {
      pattern = priv/quota/messages
      table = quota2
      username_field = username
      value_field = messages

    If you need more than this let me know.

  • Sarge888

    Sarge888 - 2012-10-07

    ah never mind. i believe i have figured it out… to those of you with similar issues read on.

    I took another look at my logs and DOVECOT-SQL.CONF file and found that the following was the main issue-

    concat('dirsize:[b]storage=[/b]', quota) AS quota

    so i replaced it with

    concat('*:bytes=', quota) AS quota_rule

    and that solved my problem. I also had to change who owned the dovecot-dict-sql.conf file to dovecot as thats the default running user as found here -

    After that everything is updating as it should.

    If i have a small error somewhere that i missed please let me know.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks