InMotion Hosting Support Center

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.


  1. Download archivemail via

  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:
email for is stored at /home/inmoti6/mail/
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/

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.

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/

This command archives emails older than 3 days.

archived 13 of 13 message(s) (68.0kB of 68.0kB) in 0.0 seconds

The archived messages can be found here:


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.

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!