[Dovecot] purge maildir folder after sa-learn

William Blunn bill+dovecot at blunn.org
Tue May 25 23:25:29 EEST 2010


On 25/05/2010 21:10, Timo Sirainen wrote:
> On Tue, 2010-05-25 at 21:29 +0200, Florian Effenberger wrote:
>    
>> Hello,
>>
>> I am looking for a command-line utility to automatically purge one
>> Maildir folder.
>>      
> How about just:
>
> rm -f /path/to/Maildir/.spam-learn/*
>    

Surely we need to delete everything in 'new' and 'cur'? :

rm -f /path/to/Maildir/.spam-learn/new/* /path/to/Maildir/.spam-learn/cur/*

Or perhaps, a bit more pipey and less risk of blowing up whilst globbing 
in the shell:

maildir=/path/to/Maildir/.spam-learn find $maildir/new $maildir/cur 
-mindepth 1 -maxdepth 1 -type f -print0 | xargs -0 -r rm -f

Regards,

Bill


More information about the dovecot mailing list