Return to Snippet

Revision: 21023
at December 2, 2009 04:49 by berkes


Initial Code
for folder in `sqlite3 .evolution/mail/imap/[email protected]/folders.db "SELECT folder_name FROM folders"`; do
    archivemail -d 60 -S 1048576 -u -v -n "imaps://username:[email protected]/$folder"; 
done

Initial URL
http://www.linux.com/archive/feature/151688

Initial Description
Change 'username' (twice!) with your imap username,'password'with your imap password, and 'example.com' (twice!) with the url of your imap mailserver.

Works on: Ubuntu with Evolution, sqlite3 and archivemail installed. 
Evolution is required because evolution stores the available folders in IMAP. 
sqlite3 is requird to extract those available folders and recurse trough them.

This command looks up all the available folders in your imap box, recurses trough them and runs archivemail to archive all the online mail. 

NOTE: remove the -n (dy-run) flag to actually archive the items.
NOTE: remove the -v (verbose) flag to be less verbose.

TODO: option to purge empty directories.
TODO: store username, password and mailserverURL in a $VAR.

Initial Title
Run Archivemail on all your IMAP folders.

Initial Tags
mail, backup, ubuntu

Initial Language
Bash