[Dovecot] Quota ignore issue
Hi Timo,
ok, in my dovecot setup, I have a setting to ignore messages in the Spam folder (I will put my dovecot -n at the end of the message), and a strange thing appears to be happening.
If I do a quota recalc on an account, It creates the maildirsize file correctly, without the contents of the Spam folder calculated into the total used.
But, it looks like when a new spam email is delivered, before the sieve rules in the lda can move it into the spam folder, it is added to the maildirsize file. Then, once it is moved into the Spam folder, if it is directly expunged from the folder, it isn't subtracted from maildirsize file.
I am using roundcube as a webmail solution, and it recognizes the Spam folder and lets users directly empty the Spam folder instead of moving it to the trash, and then removing it. If I do move the mail from the Spam folder to the Trash folder, and then empty the trash, it then puts the subtraction in the maildirsize folder.
So, either it shouldn't add it in the first place, or even though it is deleted directly from the Spam folder, it should be subtracted from the maildirsize folder, right?
Hmmm...maybe its the structure of the default sieve command that I have that is making it want to add it?
here is the default sieve script that I use in the sieve_after field :
require "fileinto"; # rule:[Spam and Virus Tag] if anyof (header :contains "Subject" "[VIRUS-TAG]", header :contains "Subject" "[SPAM-TAG]") { fileinto "Spam"; stop; }
Essentially, what is happening is that users are getting their quota filled up for messages that were in their Spam folder...
Thanks,
Tim.
and here is my dovecot -n output :
# 2.0.7: /usr/local/etc/dovecot/dovecot.conf # OS: FreeBSD 8.1-STABLE i386 auth_username_format = %Lu auth_username_translation = %@ auth_verbose = yes disable_plaintext_auth = no dotlock_use_excl = yes first_valid_uid = 100 listen = * lock_method = dotlock log_path = /local/logs/dovecot.errors mail_fsync = always mail_gid = 100 mail_location = maildir:%h/Maildir mail_nfs_index = yes mail_nfs_storage = yes mail_plugins = " quota" mail_uid = 100 managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date imapflags notify mmap_disable = yes passdb { args = /bin/checkpassword_dovecot_auth driver = checkpassword } plugin { quota = maildir:User quota quota_rule = Trash:storage=+100M quota_rule2 = Spam:ignore sieve = ~/.dovecot.sieve sieve_after = /home/mailboxes/sieve/to_spam_folder.sieve sieve_dir = ~/Maildir/sieve sieve_extensions = +notify +imapflags } protocols = imap pop3 sieve service auth { unix_listener auth-userdb { group = sn mode = 0600 user = sn } } ssl_cert =
On Wed, 2011-02-02 at 11:54 -0800, Tim Traver wrote:
But, it looks like when a new spam email is delivered, before the sieve rules in the lda can move it into the spam folder, it is added to the maildirsize file. Then, once it is moved into the Spam folder, if it is directly expunged from the folder, it isn't subtracted from maildirsize file.
I can't reproduce this, it's never added to quota when delivering to Spam. Try to reproduce with a simpler setup.
Hmmm...maybe its the structure of the default sieve command that I have that is making it want to add it?
It should happen only when the message is actually saved somewhere (you sure there's not a copy saved to some archive/something?)
plugin { quota = maildir:User quota quota_rule = Trash:storage=+100M quota_rule2 = Spam:ignore sieve = ~/.dovecot.sieve sieve_after = /home/mailboxes/sieve/to_spam_folder.sieve sieve_dir = ~/Maildir/sieve sieve_extensions = +notify +imapflags }
Try:
removing the sieve_* settings
Use a simple Sieve script for a test user:
require "fileinto"; fileinto "Spam"; stop;
- Run from command line:
doveadm quota get -u username echo "Hello world" | /usr/local/libexec/dovecot/dovecot-lda -d username doveadm quota get -u username
With these and latest v2.0 from hg (but I don't remember any related fixes for a long time) the quota never increased.
Timo,
ok, I found the issue. Config problem on some servers that were delivering the mail. We have separate servers delivering outside mail to the Maildirs, and a set of servers that do the IMAP, POP, Webmail, etc...
Seems the delivery servers didn't have the ignore the Spam folder directive. I tested, and all is well...
Sorry about that one, I hate not catching those before I ask you and the group, but i appreciate your work.
Tim.
On 2/2/2011 1:33 PM, Timo Sirainen wrote:
On Wed, 2011-02-02 at 11:54 -0800, Tim Traver wrote:
But, it looks like when a new spam email is delivered, before the sieve rules in the lda can move it into the spam folder, it is added to the maildirsize file. Then, once it is moved into the Spam folder, if it is directly expunged from the folder, it isn't subtracted from maildirsize file. I can't reproduce this, it's never added to quota when delivering to Spam. Try to reproduce with a simpler setup.
Hmmm...maybe its the structure of the default sieve command that I have that is making it want to add it? It should happen only when the message is actually saved somewhere (you sure there's not a copy saved to some archive/something?)
plugin { quota = maildir:User quota quota_rule = Trash:storage=+100M quota_rule2 = Spam:ignore sieve = ~/.dovecot.sieve sieve_after = /home/mailboxes/sieve/to_spam_folder.sieve sieve_dir = ~/Maildir/sieve sieve_extensions = +notify +imapflags } Try:
removing the sieve_* settings
Use a simple Sieve script for a test user:
require "fileinto"; fileinto "Spam"; stop;
- Run from command line:
doveadm quota get -u username echo "Hello world" | /usr/local/libexec/dovecot/dovecot-lda -d username doveadm quota get -u username
With these and latest v2.0 from hg (but I don't remember any related fixes for a long time) the quota never increased.
participants (2)
-
Tim Traver
-
Timo Sirainen