Ispconfig and dovecot email quota not updated after email erased

Discussion in 'Installation/Configuration' started by ftkyiu, Apr 29, 2012.

  1. ftkyiu

    ftkyiu New Member


    I have a quota set for some mailboxes through ispconfig.
    They got filled up. Now when i manually delete the email inside of them through ssh the quota in ispconfig doesn't change and keeps throwing errors in the log: mailbox full, even though there are NO emails in the email folder /var/vmail/user/Maildir/cur.

    As a temporary fix i increased the quota and am now experimenting on an email i created.
    I have found the following:
    By manually deleting the email in cur dovecot correctly reindexes emails upon client login, yet it doesn't update the used hd space in ispconfig quota field.

    Ex. 1) Send 2 emails to [email protected]
    Stat: Mailbox full: 3.0 KB out of 1 MB
    2) Connect via client and read email.
    Stat: Emails are moved from new to cur
    3) Now connect via ssh to mail server and delete these sent emails from cur.
    There are no copies, i checked via grep -lir "content in letter" * and find and ls -R. No copies of letters or their content exist. Not in /tmp, not in /var/spool/mail nowhere!
    Stat: Mailbox full: 3.0 KB out of 1 MB
    4) Send more mail (another 3 KB) repeating steps 1-3.
    Stat: Mailbox full: 6.0 KB out of 1 MB.

    How do i get ispconfig to reupdate the used hd space of a email user?
    I am stumped.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The quota is managed by dovecot and not ispconfig. If you deleted messages manually, you will have to instruct dovecot to recalculate the quota. The easiest way should be to send a email to the mailbox or to delete a email with imap as thsi should start the recalculation.
  3. ftkyiu

    ftkyiu New Member

    till, Thanks, but the quota is not recalculated by sending mail or logging in as i have tried this again to no avail, even though as my example demonstrates i already tried it.

    I have found the following:
    which states:
    With v2.x you can simply do: doveadm quota recalc -u username
    With v1.x you can delete the user's quota row from sql.

    I have v1.x (dovecot --version). Now i have checked phpmyadmin and i have no db for dovecot. Only for ispconfig and some other stuff.
    The config file /etc/dovecot.conf (generated by ispconfig) says:
    plugin {
    [b]quota = dict:user::file:/var/vmail/%d/%n/.quotausage[/b]
    auth default {
      passdb sql {
        # Path for SQL configuration file
        [b]args = /etc/dovecot/dovecot-sql.conf[/b]
    Yet sql.conf leads me to the ispconfig database:
    user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'
    How would i go about deleting said row from sql because i cant find anything in ispconfigs database having anything remotely to do with used quota space?

    P.S. it seems that dovect only updates used quota space when
    1) a user that is NOT logged in recieves an email.
    and only increases it, deleting email doesn't decrease the used quota space. (Yes, it's not in the .Trash, fully expunged).

    P.P.S. FIxed!
    1) delete /var/vmail/domain.tld/user/Maildir/.quotausage
    2) login via imap
    3) logout
    4) update ispconfig
    5) in about 30 minutes or less the quota usage will update.
    Last edited: Apr 30, 2012
  4. diablo666

    diablo666 Active Member HowtoForge Supporter

    Hi ftkyiu,
    i've got youre problem.

    for the fix, what do you mean with "update ispconfig"?

    Tnx for response.
  5. ftkyiu

    ftkyiu New Member

    I don't remember, lol.
    All that i remember is that you delete the .quotausage file.
    Make a backup just in case.
    Last edited: May 3, 2013
  6. diablo666

    diablo666 Active Member HowtoForge Supporter

    Ok, i've updated to lates version and all is fixed now. ;)
  7. Ovidiu

    Ovidiu Active Member


    But I checked and its there inside /etc/dovecot/dovecot.conf:

    Any ideas? My quota display inside roundcube and ISPCFG3 isn't updating.

    Using a server setup according to the perfect server wheezy + nginx
  8. mccharlet

    mccharlet Member HowtoForge Supporter


    Add this line to /et/dovecot/dovcot.conf

    mail_plugins = quota

    Best regards
  9. calbasi

    calbasi New Member

    I've added:
    mail_plugins = quota​
    to /et/dovecot/dovcot.conf
    but I still get:
    doveadm quota recalc -u username
    doveadm(root): Fatal: Unknown command 'quota', but plugin quota exists. Try to set mail_plugins=quota​
  10. Jesse Norell

    Jesse Norell Well-Known Member

    Maybe post your full dovecot.conf (I assume 'dovcot.conf' above is a typo).
  11. calbasi

    calbasi New Member

    My issue is solved. I follow these steps:
    - Enabling "mail_plugins=quota" in the root of dovecot config file (not inside a rule, where is already present)
    - Recalculating quotes

Share This Page