[Dovecot] Dovecot 1.2 with MySQL limit Trash folder

Damien Robinet damien at robinet.net
Tue May 24 21:29:01 EEST 2011


Hi All,

I need your help to limit the size of the Trash folder.
I want to exclude the Trash folder in my user quota. But I do not want
the Trash folder can not exceed 10M for example.
I can manage to exclude the size of the Trash folder. But I can not
limit the size of the folder.

On my test, I've bytes=512000 for the Trash folder.
But the user can move more that 512000B on the Trash folder ...

Could you help me please ?

Bests Regards,
Damien


################################
## My SQL query (dovecot-sql.conf) ##
################################
user_query = SELECT CONCAT( '/home/vmail/', maildir ) AS home, CONCAT(
'/home/vmail/', maildir ) AS sieve_dir, 201 AS uid, 201 AS gid,
CONCAT('*:storage=',ROUND((quota*1048.576)),'B') AS quota_rule,
'Trash:storage=50000B' AS quota_rule2, 'Trash:ignore' AS quota_rule3
FROM mail_mailbox WHERE username = '%u' AND actif = '1'

############
## My Log: ##
############
2011-05-24 20:08:59 imap-login: Info: Login:
user=<postmaster at domain.tld>, method=PLAIN, rip=192.168.1.101,
lip=192.168.1.10
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Loading modules
from directory: /usr/lib/dovecot/modules/imap
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Module loaded:
/usr/lib/dovecot/modules/imap/lib10_quota_plugin.so
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Module loaded:
/usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Module loaded:
/usr/lib/dovecot/modules/imap/lib20_autocreate_plugin.so
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Module loaded:
/usr/lib/dovecot/modules/imap/lib20_expire_plugin.so
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Effective
uid=201, gid=201, home=/home/vmail/d/o/domain.tld/postmaster/
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Quota root:
name=user backend=dict args=:proxy::quota
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Quota rule:
root=user mailbox=* bytes=1048576 messages=0
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Quota rule:
root=user mailbox=Trash bytes=512000 messages=0
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: expire: No
expire or expire_altmove settings - plugin disabled
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: dict quota:
user=postmaster at domain.tld, uri=proxy::quota, noenforcing=0
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: maildir:
data=/home/vmail/d/o/domain.tld/postmaster/
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: maildir++:
root=/home/vmail/d/o/domain.tld/postmaster, index=, control=,
inbox=/home/vmail/d/o/domain.tld/postmaster
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Namespace :
Using permissions from /home/vmail/d/o/domain.tld/postmaster:
mode=0700 gid=-1
2011-05-24 20:08:59 IMAP(postmaster at domain.tld): Info: Connection
closed bytes=38/363

###################
## My dovecot.conf ##
###################
dict {
  quota = mysql:/etc/dovecot/dovecot-quota.conf
}
plugin {
  args = /etc/dovecot/dovecot-sql.conf
  quota = dict:user::proxy::quota
  autocreate = Junk
  autocreate2 = NonJunk
  autocreate3 = Drafts
  autocreate4 = Sent
  autocreate5 = Trash
  autosubscribe = Junk
  autosubscribe2 = NonJunk
  autosubscribe3 = Drafts
  autosubscribe4 = Sent
  autosubscribe5 = Trash
}


More information about the dovecot mailing list