delete/archive old mail

Robert Schetterer rs at
Mon Oct 13 11:46:56 UTC 2014

Am 13.10.2014 um 13:42 schrieb sottilette at
> Hi everybody,
>         I store user's mail in the old mbox format.
> I have many scripts to manage users that works fine with mbox.
> I use the very old script to delete mail older than NN
> days for selected users (nightly cron job). Still works fine with my
> CentOS dovecot-2.0.16.
> Now I want move the mail to a sort of archive folder instead of simply
> deleting it from the inbox for some users.
> Is there a similar script or some simple triks?
> Thanks, F.

perhaps you will find some ideas here

YEAR=`/bin/date +%Y`
/usr/bin/doveadm expunge -d -u * mailbox
user-backup\*$YEAR*\* savedbefore 10d

Best Regards
MfG Robert Schetterer

[*] sys4 AG, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein

More information about the dovecot mailing list