Voytek Eymont
2012-Jul-10 11:25 UTC
[Dovecot] getting rid of old spam from +spam Maildir ?
I'm trying to setup per user '+spam' delivery from amavis tags, so that each user gets any mails tagged as spam to 'spam' Maildir via +spam Dovecot lmtp delivery. after say 7 days I want to delete all spams older than 7 days, if I simply delete mail files from the file system, is that a 'bad thing' ? what is a proper way to do that, and scripts ? for removing/archiving old uncollected emails in main INBOX I use archivemail from sf, but, don't think I can do subfoldrs with archivemail any pointers (and scripts) welcomed, thanks -- Voytek
Robert Schetterer
2012-Jul-10 11:34 UTC
[Dovecot] getting rid of old spam from +spam Maildir ?
Am 10.07.2012 13:25, schrieb Voytek Eymont:> I'm trying to setup per user '+spam' delivery from amavis tags, so that > each user gets any mails tagged as spam to 'spam' Maildir via +spam > Dovecot lmtp delivery.i have no amavis, i use a global sieve rule to deliver tagged mail into special Junk folder, and virtual plugin to get users the chance to download tagged mails from Junk folder via pop3 too look i.e here http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples> > after say 7 days I want to delete all spams older than 7 days, > if I simply delete mail files from the file system, is that a 'bad thing' ?perhaps use daily cron with something like this doveadm expunge -A mailbox Junk savedbefore 7d;> > what is a proper way to do that, and scripts ? > > for removing/archiving old uncollected emails in main INBOX I use > archivemail from sf, but, don't think I can do subfoldrs with archivemail > > any pointers (and scripts) welcomed, thanks > >i am not sure what you ask for here, looking for archive solution ? -- Best Regards MfG Robert Schetterer
Wojciech Puchar
2012-Jul-10 12:10 UTC
[Dovecot] getting rid of old spam from +spam Maildir ?
> Dovecot lmtp delivery. > > after say 7 days I want to delete all spams older than 7 days, > if I simply delete mail files from the file system, is that a 'bad thing' ? >i don't use lmtp so maybe i'm wrong but if you use maildir format just deleting/moving files always work properly
Andrzej A. Filip
2012-Jul-10 15:54 UTC
[Dovecot] getting rid of old spam from +spam Maildir ? [ auto purging spambox]
On 07/10/2012 01:25 PM, Voytek Eymont wrote:> I'm trying to setup per user '+spam' delivery from amavis tags, so that > each user gets any mails tagged as spam to 'spam' Maildir via +spam > Dovecot lmtp delivery. > > after say 7 days I want to delete all spams older than 7 days, > if I simply delete mail files from the file system, is that a 'bad thing' ? > [...]IMHO 7 days is dangerously too short. False positives during vacations happen too ;-) I would suggest at least 30 days (as used by Gmail).
Voytek Eymont
2012-Aug-03 13:09 UTC
[Dovecot] getting rid of old spam from +spam Maildir ?
On Tue, July 10, 2012 9:34 pm, Robert Schetterer wrote:> perhaps use daily cron with something like this > > doveadm expunge -A mailbox Junk savedbefore 7d;where am I going wrong ? nothing gets removed: # pwd /var/mail/vhosts/sbt.net.au/spam at sbt.net.au/.spam/cur # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 7day # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 7d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 5d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 4d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 3d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 2d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 1d # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 1w # ls | wc 532 532 30884 # doveadm expunge -u spam at sbt.net.au mailbox .spam savedbefore 1w # ls | wc 532 532 30884 ------------- ls -al -rw------- 1 vmail vmail 5921 Jul 9 21:55 1341834948.M445074P17475.geko.sbt.net.au,S=5921,W=6003:2, -rw------- 1 vmail vmail 3021 Jul 9 22:06 1341835577.M701903P17756.geko.sbt.net.au,S=3021,W=3125:2, .... -- Voytek
Robert Schetterer
2012-Aug-03 13:14 UTC
[Dovecot] getting rid of old spam from +spam Maildir ?
Am 03.08.2012 15:09, schrieb Voytek Eymont:> > On Tue, July 10, 2012 9:34 pm, Robert Schetterer wrote: > >> perhaps use daily cron with something like this >> >> doveadm expunge -A mailbox Junk savedbefore 7d; > > where am I going wrong ? > > nothing gets removed: > > # pwd > /var/mail/vhosts/sbt.net.au/spam at sbt.net.au/.spam/cur > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 7day > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 7d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 5d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 4d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 3d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 2d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 1d > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox spam savedbefore 1w > # ls | wc > 532 532 30884 > # doveadm expunge -u spam at sbt.net.au mailbox .spam savedbefore 1w > # ls | wc > 532 532 30884 > > ------------- > ls -al > -rw------- 1 vmail vmail 5921 Jul 9 21:55 > 1341834948.M445074P17475.geko.sbt.net.au,S=5921,W=6003:2, > -rw------- 1 vmail vmail 3021 Jul 9 22:06 > 1341835577.M701903P17756.geko.sbt.net.au,S=3021,W=3125:2, > .... >do you use expire plugin ? http://wiki2.dovecot.org/Plugins/Expire -- Best Regards MfG Robert Schetterer
Charles Marcus <CMarcus at Media-Brokers.com> writes:> On 2012-08-03 6:33 PM, Voytek Eymont <voytek at sbt.net.au> wrote: >> don't know, looking this morning it shows like below, the 00:05:05 is >> probably last time I did 'ls'? I was doing 'ls' or web mail refresh, to >> see what gets removed from 'spam' box, before and after each attempt to >> expunge : >> >> date.saved: 2012-08-03 00:05:05 > > The 'date.saved:' is the date/time that the message was moved into that > folder.Perhaps this related thread starting at http://dovecot.org/list/dovecot/2012-July/067199.html and ending with the patch by Timo http://dovecot.org/list/dovecot/2012-July/067423.html may be of interest to the OP. Joseph Tam <jtam.home at gmail.com>