[Dovecot] Move to a Specific Folder

Darvin Denmian darvin.denmian at gmail.com
Fri Sep 18 17:32:27 EEST 2009


Thanks, for all replies.

I'll use find :)


On Fri, Sep 18, 2009 at 11:06 AM, Andrew Schulman
<andrex at alumni.utexas.net> wrote:
>> > Is there a way to automatically expurge or move messages from a
>> > specific folder to another folder after "X" days?
>>
>> I use a daily cron job for this.  It runs a script that deletes messages
>> more than 6 months old from the Junk folder.
>
> Looking at my nightly spam control job, I see that it essentially runs
>
> find ~/.mail/.Junk/{new,cur} -type f -mtime +180 -delete
>
> which deletes all files in the Junk folder that are more than 180 days old.
> If instead of deleting those files you wanted to move them into another
> directory, say $targetdir, then you could replace -delete in the above by
> e.g.
>
> -exec mv --target-directory=$targetdir '{}' +
>
> See find(1) for details.
> A.
>
>


More information about the dovecot mailing list