Run Archivemail on all your IMAP folders.


/ Published in: Bash
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. for folder in `sqlite3 .evolution/mail/imap/username@example.com/folders.db "SELECT folder_name FROM folders"`; do
  2. archivemail -d 60 -S 1048576 -u -v -n "imaps://username:[email protected]/$folder";
  3. done

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.