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

    Hello.

    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 testbox@test.te
    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: http://dovecot.org/list/dovecot/2012-February/063777.html
    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:
    Code:
    plugin {
    [b]quota = dict:user::file:/var/vmail/%d/%n/.quotausage[/b]
    sieve=/var/vmail/%d/%n/.sieve
    }
    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:
    Code:
    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 Member

    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.
    G'luck.
     
    Last edited: May 3, 2013
  6. diablo666

    diablo666 Member

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

    Ovidiu Active Member

    tried:

    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

    Hi,

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

    mail_plugins = quota

    Best regards
     

Share This Page