[Dovecot] Thunderbird Archive to slower storage - sort of alternate storage

Timo Sirainen tss at iki.fi
Tue Mar 13 18:49:54 EET 2012


On 13.3.2012, at 16.36, Marcio Merlone wrote:

> Hi people,
> 
> When a user archives a message from Thunderbird it moves to an IMAP folder "Archives", everyone knows that. I use dovecot 1:1.2.9-1ubuntu6.5 on Ubuntu 10.04 and want to move that folder (and respective IMAP sub-folders) to a slower storage, link it to original location and my first idea for this is
> 
> find -type d -name .Archives\* -print0 | \
> while read -d $'\0' archive; do \
> mv "$archive" /dead/Emails/jhon.doe/; \
> ln -s "/dead/Emails/jhon.doe/$archive" .; done
> 
> It works, given that the files are not locked. I could restart dovecot before so it would unlock the files, but there is no guarantee it does not get locked again before the find finishes.

I'm not sure what you mean by locks. dovecot-uidlist.lock? Anyway, the above is safe only if the IMAP client doesn't try to access the mailboxes during the move. Otherwise it can become confused.

> I took a look on mailling list archives, but could not find something like that and was wondering what you guys use (if any) for such task and what are the recommendations, best practices, solutions for that?

A perfectly working solution would be to (upgrade to v2.x and) switch to sdbox or mdbox format with alt storage enabled, then you could simply do:

doveadm altmove -A mailbox 'Archives*' all



More information about the dovecot mailing list