Shayne Jellesma
2010-May-30  11:34 UTC
[Dovecot] Dovecot 1.2 - Quotas - Ignoring Trash folder
Hello guys,
 
Firstly I would like to state that I am fairly new to Dovecot. I have played
around with it in the past here and there but mainly with debian packages.
I have compiled this version of Dovecot from source, so please go easy with
me.
 
Ok now down to my questions:
I am having trouble getting Dovecot to 'ignore' the Trash folder when
summing up the used quota for a user. 
 
I am running Dovecot 1.2.11 (with LDA), Postfix 2.5.5, and Postfixadmin 2.3.
I am able to send and receive emails fine. Roundcube displays the quota used
but this quota also counts what is in the users Trash can. Postfix is
configured to hand over delivering of the mail to Dovecot.
I have tried different methods from the documentation on ignoring the Trash
folder, but have not come up with anything that has worked yet.
 
If someone could point me in the right direction, that would be great.
 
I apologise now if I have not included all required information, I did read
the mailing list guidelines and believe I have follow all required steps.
 
 
 
 
charged:/usr/local/etc# dovecot --version
1.2.11
charged:/usr/local/etc#
 
 
charged:/usr/local/etc# dovecot -n
# 1.2.11: /usr/local/etc/dovecot.conf
# OS: Linux 2.6.26-2-686 i686 Debian 5.0.4 ext3
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot12.log
info_log_path: /var/log/dovecot12.log
protocols: imap imaps pop3 pop3s
listen: 118.127.29.214
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
first_valid_uid: 5000
last_valid_uid: 5000
first_valid_gid: 5000
last_valid_gid: 5000
mail_privileged_group: vmail
mail_uid: 5000
mail_gid: 5000
mail_location: maildir:/var/vmail/%d/%n/Maildir
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
namespace:
  type: private
  separator: .
  inbox: yes
  list: yes
  subscriptions: yes
lda:
  postmaster_address: postmaster at ignitioncarclub.com
  mail_plugins: quota
  mail_plugin_dir: /usr/local/lib/dovecot/lda
  quota_full_tempfail: no
  auth_socket_path: /var/run/dovecot/auth-master
auth default:
  mechanisms: plain login
  passdb:
    driver: sql
    args: /usr/local/etc/dovecot-sql.conf
  userdb:
    driver: sql
    args: /usr/local/etc/dovecot-sql.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
plugin:
  quota: maildir:ignore=Trash
  trash: /usr/local/etc/dovecot-trash.conf
charged:/usr/local/etc#
 
 
charged:/usr/local/etc# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
driver = mysql
connect = host=localhost dbname=xxx user=mailuser password=xxx
default_pass_scheme = MD5-CRYPT
user_query = SELECT maildir, 5000 AS uid, 5000 AS gid,
CONCAT('*:storage=',
quota, 'B') AS quota_rule FROM mailbox WHERE username = '%u' AND
active '1'
password_query = SELECT username as user, password, '/var/vmail/%d/%n'
as
userdb_home, 'maildir:/var/vmail/%d/%n' as userdb_mail, 5000 as
userdb_uid,
5000 as userdb_gid FROM mailbox WHERE username = '%u' AND active =
'1'
charged:/usr/local/etc#
 
 
 
charged:/usr/local/etc# dpkg -l | grep postfix
ii  postfix                           2.5.5-1.1
High-performance mail transport agent
ii  postfix-mysql                     2.5.5-1.1                  MySQL map
support for Postfix
charged:/usr/local/etc#
 
 
 
 
Regards,
Shayne Jellesma
Network Administrator / ICT Support
St Martins Lutheran College
Web:  <http://www.stmartins.sa.edu.au> http://www.stmartins.sa.edu.au
Phone: (08) 87 251 430
Skype: shayne.jellesma.smlc
Hello, On 30.05.2010 13:34, wrote Shayne Jellesma:> Hello guys, > > Firstly I would like to state that I am fairly new to Dovecot. I have played > around with it in the past here and there but mainly with debian packages. > I have compiled this version of Dovecot from source, so please go easy with > me. > > Ok now down to my questions: > I am having trouble getting Dovecot to 'ignore' the Trash folder when > summing up the used quota for a user.[snip]> plugin: > > quota: maildir:ignore=TrashChange this to quota = maildir [snip]> > charged:/usr/local/etc# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf > > driver = mysql > > connect = host=localhost dbname=xxx user=mailuser password=xxx > > default_pass_scheme = MD5-CRYPT > > user_query = SELECT maildir, 5000 AS uid, 5000 AS gid, CONCAT('*:storage=', > quota, 'B') AS quota_rule FROM mailbox WHERE username = '%u' AND active > '1'Insert a second quota_rule in your sql query 'Trash:ignore' AS quota_rule2 See also http://wiki.dovecot.org/Quota/1.1#Quota_rules Regards, e-frog
On 30.05.2010 15:28, wrote Shayne Jellesma:> Hello e-frog, > > Thanks for your reply. I have made the changes you suggested and it is still > not working. > > The new updated SQL query is as follows: > user_query = SELECT maildir, 5000 AS uid, 5000 AS gid, CONCAT('*:storage=', > quota, 'B') AS quota_rule, 'Trash:ignore' AS quota_rule2 FROM mailbox WHERE > username = '%u' AND active = '1' >Looks correct and works for me. You could try and set mail_debug=yes in dovecot.conf This should log the quota rules dovecot is using once you login. e.g. May 30 15:36:52 server dovecot: IMAP(xxx): Quota rule: root=user mailbox=* bytes=1073741824 messages=0 May 30 15:36:52 server dovecot: IMAP(xxx): Quota rule: root=user mailbox=Trash ignored> Regards, > > Shayne Jellesma > Network Administrator / ICT Support > St Martins Lutheran College > Web: http://www.stmartins.sa.edu.au > Skype: shayne.jellesma.smlc > > -----Original Message----- > From: dovecot-bounces+shayne=stmartins.sa.edu.au at dovecot.org > [mailto:dovecot-bounces+shayne=stmartins.sa.edu.au at dovecot.org] On Behalf Of > e-frog > Sent: Sunday, 30 May 2010 10:09 PM > To: dovecot at dovecot.org > Subject: Re: [Dovecot] Dovecot 1.2 - Quotas - Ignoring Trash folder > > Hello, > > On 30.05.2010 13:34, wrote Shayne Jellesma: >> Hello guys, >> >> Firstly I would like to state that I am fairly new to Dovecot. I have >> played around with it in the past here and there but mainly with debian > packages. >> I have compiled this version of Dovecot from source, so please go easy >> with me. >> >> Ok now down to my questions: >> I am having trouble getting Dovecot to 'ignore' the Trash folder when >> summing up the used quota for a user. > > [snip] > >> plugin: >> >> quota: maildir:ignore=Trash > > Change this to > > quota = maildir > > [snip] > >> >> charged:/usr/local/etc# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf >> >> driver = mysql >> >> connect = host=localhost dbname=xxx user=mailuser password=xxx >> >> default_pass_scheme = MD5-CRYPT >> >> user_query = SELECT maildir, 5000 AS uid, 5000 AS gid, >> CONCAT('*:storage=', quota, 'B') AS quota_rule FROM mailbox WHERE >> username = '%u' AND active = '1' > > Insert a second quota_rule in your sql query > > 'Trash:ignore' AS quota_rule2 > > See also http://wiki.dovecot.org/Quota/1.1#Quota_rules > > Regards, > e-frog