Auto-archiving

@lbutlr kremels at kreme.com
Fri Oct 7 13:13:15 UTC 2016


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