Can I use archivemail to archive my old emails?

Experience Level: Advanced
Articles labeled as Advanced are those in which we generally explain concepts and ideas on how to accomplish something, but we cannot directly assist with, such as custom coding.
Print E-mail:

I was recently asked in our forums about archivemail, a python script that helps archive old email. After further research, I found that it is supported, and in this article I'll give you some details on how to setup and use it if it sounds like something you may find useful.

For official documentation for archivemail, please see the archivemail sourceforge page.

INSTALLATION

  1. Download archivemail via http://sourceforge.net/projects/archivemail/files/

  2. Using your File Manager within cPanel, upload the .tar.gz file (archivemail-0.9.0.tar.gz) to your cgi-bin. After uploading, use the File Manager to then extract the file (right click the file and choose extract).

  3. To make the directory structure easier to remember, I've renamed the new archivemail-0.9.0 folder to archivemail.

Examples of Usage

archivemail will need to be ran using a cron job. For more help running a cron job, please see: How to run a cron job.

When looking at the examples below, please note these settings:

email address to archive: brad@inmotiontesting.com
email for brad@inmotiontesting.com is stored at /home/inmoti6/mail/inmotiontesting.com/brad
cPanel username: inmoti6
path to archivemail: /home/inmoti6/public_html/cgi-bin/archivemail/archivemail

I have setup the cron jobs to email me the output, which is presented below. To prevent receiving status emails, please use the -q flag.

-q, --quiet

Turns on quiet mode. Do not print any statistics about how many messages were archived. This should be used if you are running archivemail from cron.


Archive email older than 1 year
The command to run (the cron job)
/home/inmoti6/public_html/cgi-bin/archivemail/archivemail -nd 365 /home/inmoti6/mail/inmotiontesting.com/brad

This command would archive emails older than 365 days. The n flag means just to test the command, but don't actually archive any emails.

OUTPUT
/home/inmoti6/mail/inmotiontesting.com/brad:
I would have archived 0 of 13 message(s) (0B of 68.0kB) in 0.1 seconds


Archive email older than 3 days
The Command to run (the cron job)
/home/inmoti6/public_html/cgi-bin/archivemail/archivemail -d 3 /home/inmoti6/mail/inmotiontesting.com/brad

This command archives emails older than 3 days.

OUTPUT
/home/inmoti6/mail/inmotiontesting.com/brad:
archived 13 of 13 message(s) (68.0kB of 68.0kB) in 0.0 seconds

The archived messages can be found here:

/home/inmoti6/mail/inmotiontesting.com/brad_archive.gz

The email is actually archived in Mbox format. MBox stores all of your email in one single file. From our reading, there is unfortunately not an option to change the format the emails are stored in. Our servers no longer use mbox format for storing email, so you'll need another program to actually read the archived email.

You can use notepad to open the file and read your emails. A quick search online shows there are several programs you can use to read / convert the email, many of which seem to require purchase though. We did find that Windows MBox Viewer seemed to work quite well, however we have not used it extensively.

 
Rating:
 
Please log in to rate this article.
Like this Article?
Notify Me of Updates!
Please login to subscribe to receive notifications when this article is updated.
Prerequisite Articles
None

Comments

Currently no comments

You must log in before commenting.

Need more Help?

Search
Current Customers
Chat:Click to Chat Now
Call:888-321-HOST (4678)
E-mail:support@InMotionHosting.com
Ticket Submit a Support Ticket
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Not a Customer?
Get web hosting from a company that is here to help. Sign up today!

Follow InMotion Hosting!

 4244 Followers. Follow Us!

Have a Question?

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 5pm EST, Monday - Friday)

Recent Questions