HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Ispconfig and dovecot email quota not updated after email erased (http://www.howtoforge.com/forums/showthread.php?t=57107)

ftkyiu 29th April 2012 19:59

Ispconfig and dovecot email quota not updated after email erased
 
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.

till 30th April 2012 09:51

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.

ftkyiu 30th April 2012 14:45

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...ry/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 {
quota = dict:user::file:/var/vmail/%d/%n/.quotausage
sieve=/var/vmail/%d/%n/.sieve
}
auth default {
...
  passdb sql {
    # Path for SQL configuration file
    args = /etc/dovecot/dovecot-sql.conf
  }
}

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.

diablo666 3rd May 2013 12:50

Hi ftkyiu,
i've got youre problem.

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

Tnx for response.

ftkyiu 3rd May 2013 15:10

I don't remember, lol.
All that i remember is that you delete the .quotausage file.
Make a backup just in case.
G'luck.

diablo666 3rd May 2013 17:18

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

Ovidiu 3rd June 2014 16:20

tried:

Quote:

doveadm quota recalc -u username
doveadm(root): Fatal: Unknown command 'quota', but plugin quota exists. Try to set mail_plugins=quota
But I checked and its there inside /etc/dovecot/dovecot.conf:

Quote:

protocol imap {
mail_plugins = quota imap_quota
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
mail_plugins = quota
}
protocol lda {
mail_plugins = sieve quota
}
Any ideas? My quota display inside roundcube and ISPCFG3 isn't updating.

Using a server setup according to the perfect server wheezy + nginx

mccharlet 4th June 2014 09:53

Hi,

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

mail_plugins = quota

Best regards


All times are GMT +2. The time now is 01:15.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.