[Dovecot] (Somewhat urgent) Problem with maildir++ quota

Santiago Romero sromero at servicom2000.com
Thu Feb 12 10:08:50 EET 2009


 Hi.

 I have an strange problem with dovecot's maildir quota and postfix.

 I've tested quota and it works fine but sometimes there are users that 
having their Maildir/ empty, they trigger the "quota exceeded" message 
when someone sends email to them.

 Some config / version info:

### Versions:
ii  dovecot-common      1:1.0.10-1ubuntu5.1
ii  dovecot-imapd         1:1.0.10-1ubuntu5.1
ii  dovecot-pop3d         1:1.0.10-1ubuntu5.1

### From dovecot.conf:

(...)
  # SQL database <doc/wiki/AuthDatabase.SQL.txt>
  userdb sql {
    # Path for SQL configuration file
    args = /etc/dovecot/dovecot-mysql.conf
  }

(...)

dict {
  #quota = mysql:/etc/dovecot-dict-quota.conf
}

(...)

plugin {
  quota = maildir:storage=51200
}


### dovecot-mysql.conf (splitted to be readable):
user_query = SELECT maildir, 5000 AS uid, 5000 AS gid,
    concat('maildir:storage=', floor(quota/1024)) AS quota FROM
    mailbox WHERE username = '%u' AND active = '1'


### Database "mailbox" record example:
| prueba at domain.com           | Password | prueba                |  
domain.com/prueba/               
|  51200000 | domain.com | 2009-02-02 10:01:24 | 2009-02-02 10:07:46 
|      1 |


 The symptons: users are working nicely, and quota works (If I create a 
new user and set it a quota of, say, 1MB, I can send him msgs until 
Maildir reachs 1MB, after that I get "quota exceeded" messages). But 
sometimes there are users with the Maildir empty that can't receive 
messages and trigger the "quota exceeded" warning. Users always download 
messages by POP.

 Removing "maildirsize" file in their folder fixes the problem. Also 
fixes it changing the quota to any value (maildirsize is then removed 
and recreated after a new message arrives for the user).

 Sometime that I don't know if it's strange is that I don't see 
"removing" messages in the maildirsize file after user downloads 
messages. I mean that I can't see "-1" lines in maildirsizes:

# cat prueba/maildirsize
51200000S
0 0
615 1
1540 1
11446 1
46085 1
2623 1
21218 1
2815301 1
15110 1
21289 1
18330 1
(and so).

 Any idea of what's going on? Shouldn't appear "MSGSIZE    -1"  lines in 
maildirsize file to "restore" space in Maildir after POP RETRs?

 Currently I'm fixing the problem with a regular:

 # find /home/vmail/vhosts -name "maildirsize"  -exec rm {} \;

 But there must exist a better solution (or maybe my config is wrong).

 Thanks a lot for any help.

-- 
Santiago Romero




More information about the dovecot mailing list