Auto-archiving

Julien Lambot jlambot at gmail.com
Fri Oct 7 14:53:48 UTC 2016


Hi List

We use this for archiving, through cronjob,
https://gist.github.com/pkern/3730543
Works prety fine.

On Fri, Oct 7, 2016 at 3:13 PM, @lbutlr <kremels at kreme.com> wrote:

> On 05 Oct 2016, at 23:50, Aki Tuomi <aki.tuomi at dovecot.fi> wrote:
> >> On October 6, 2016 at 8:05 AM "@lbutlr" <kremels at kreme.com> wrote:
> >>
> >>
> >> I’d like to know if there is a way to tell dovecot to
> >>
> >> 1) move messages older than # days to the Archive folder
> >> 2) rebuild the indexes
> >> 3) remove any folders that are left with no mail
> >>
> >> Preferably, I’d like this to be a action I an schedule via crontab or
> something to fire off for any users that want it. So, I do not want it to
> do this across all users and mailboxes.
> >
> > Have you tried doveadm move?
>
> I don’t see anything in doveadm move that supports the age of the message.
> at least according to doveadm-move (and buy, that was fun o find since it
> is not mentioned anywhere in man doveadm unless you notice the (1) might
> indicate a man page!) it only supports dates, which makes simply doing this
> in a crontab (or something similarly straightforward) more problematic
> since I would have to generate a date string.
>
> Ah, wait, I just found the DATE SPECIFICATION section of
> doveadm-search-query.
>
> Nothing quite like having three man pages to get useful information on one
> command.
>
> Thanks for the forcing me to look again though.
>
> doveadm move -u jane Archive mailbox INBOX BEFORE 30d
>
> And then I have to do that for all folders one at a time, yes?
>


More information about the dovecot mailing list