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.
- for folder in `sqlite3 .email@example.com/folders.db "SELECT folder_name FROM folders"`; do
- archivemail -d 60 -S 1048576 -u -v -n "imaps://username:[email protected]/$folder";
You need to login to post a comment.