[Dovecot] Dovecot 1.2, problem with SQL quota and mail aliases

Jacek Osiecki joshua at hybrid.pl
Thu Feb 17 15:10:59 EET 2011


Hello,

I have a small server running dovecot 1.2 (still not balsy enough to 
switch to 2.0 - virtual sql accounts, managesieve etc.). There are no
local users - only ones defined in the SQL database, and everything else 
(including quota) is defined in SQL db too. Dovecot is used as IMAP 
daemon, and dovecot-lda is responsible for delivery (in order to make use 
of sieve and managesieve). I know that my configuration might be a bit 
ancient, but this is not referring to any bug (at least I think so) and 
rather to errors I've made in configuration.

Several users have reported, that they are running out of quota even 
though their mailboxes are empty. I thought these were some single cases, 
but recently I discovered that this situation occurs when:
  - user john at domain.com has a mail alias, eg. john.smith at domain.com
  - he logs in to the imap account (using MUA or webmail) using his alias
    (john.smith at domain.com).

In effect, all incoming emails for john at domain.com are increasing the 
counters (both "bytes" and "messages"), but since user logs in using 
john.smith at domain.com - anything he deletes from the mailbox decreases
the records for john.smith at domain.com. Finally, John has two records:

+---------------------------+-----------+----------+
| username                  | bytes     | messages |
+---------------------------+-----------+----------+
| john.smith at domain.com     |  -5488133 |      -13 |
| john at domain.com           | 341411029 |     1111 |
+---------------------------+-----------+----------+

The record for john at domain.com finaly reaches the quota limit - and even 
removing all emails does not help.

My /etc/dovecot/dovecot-dict-quota.conf looks like this:

map {
   pattern = priv/quota/storage
   table = quota
   username_field = username
   value_field = bytes
}
map {
   pattern = priv/quota/messages
   table = quota
   username_field = username
   value_field = messages
}

And my question is: what is used as "username"? Always the username given 
wher user logs in? Is there a way to provide some dictionary to translate 
all aliases to the real username?

Best regards,
-- 
Jacek Osiecki joshua at ceti.pl GG:3828944
I don't want something I need. I want something I want.


More information about the dovecot mailing list