5 messages in net.sourceforge.lists.courier-sqwebmail[sqwebmail] Moving a message from the...
FromSent OnAttachments
Pawel TeczaMay 18, 2006 6:43 am 
Sam VarshavchikMay 18, 2006 3:31 pm 
Pawel TeczaMay 19, 2006 1:11 am 
Pawel TeczaMay 19, 2006 4:06 am 
Sam VarshavchikMay 20, 2006 3:06 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[sqwebmail] Moving a message from the TrashActions...
From:Pawel Tecza (p.te@net.icm.edu.pl)
Date:May 18, 2006 6:43:07 am
List:net.sourceforge.lists.courier-sqwebmail

Hello Sam,

The Sqwebmail shouldn't touch a maildirsize file if a user moves a message from the Trash to another folder, because the message isn't purged and still exists in a user Maildir. Now the Sqwebmail subtracts a size of a message, so a user's quota is calculated badly.

I've fixed it and my patch is below:

--- courier-0.53.1.20060502/webmail/maildir.c-orig 2004-10-22 01:49:52.000000000
+0200 +++ courier-0.53.1.20060502/webmail/maildir.c 2006-05-18 15:20:59.000000000
+0200 @@ -890,16 +890,16 @@ || !maildirquota_countfolder(destdir)) && maildirquota_countfile(file)) { - if (!from_shared) maildir_quota_deleted(".", -filesize, -1); } - else if (!dest_shared && maildirquota_countfolder(destdir) && - (from_shared || !maildirquota_countfolder(fromdir)) - ) + else if ((!dest_shared && maildirquota_countfolder(destdir) && + (from_shared || !maildirquota_countfolder(fromdir))) || + (!dest_shared && maildirquota_countfolder(destdir) && + !from_shared && maildirquota_countfolder(fromdir) && + strcmp(from, INBOX "." TRASH) == 0)) /* Moving FROM trash */ { - if (maildir_quota_add_start(".", &quotainfo, filesize, 1, NULL)) {

It's rather a dirty hack, because at first I add a size of a message to a maildirsize file and next it's subtracted from the file by maildir_newcheck() function. In the maildirsize file we have the following lines then:

<msg_size> 1 -<msg_size> -1

Please fix it better if you know how to do it :)

Have a nice day,