Ubuntu – Using Thunderbird to automatically backup the email account


I use Thunderbird to backup my web-based email account: I open Thunderbird and copy the mail messages from the Inbox to a local folder.

Is there a way to do this automatically every day, so that I don't have to open Thunderbird all the time?

EDIT: GMVault is very useful for GMail accounts. For non-GMail account, the getmail method should probably be used.

Best Answer

Thunderbird uses the IMAP protocol to download messages. There are command-line IMAP utilities with which you can automate connecting and downloading messages from your account. Look at getmail (http://pyropus.ca/software/getmail/) as a possible option. You can very easily automate this with a cron job (How do I set up a Cron job?).

As an example you could create a ~/.getmail/getmailrc file with something like:

type = SimplePOP3Retriever
server = pop.example.net
username = your.username
password = mailpassword

type = Maildir
path = ~your-username/Maildir/

Then in /etc/cron.d add a file "retrieve-email" with something like this:

15 10 * * * your-username getmail

his will cause getmail to download your email every day at 10:15 AM and put it in the Maildir directory.

PLEASE don't use these examples as they are; they are incomplete and illustrative only, I haven't tested them. Read the documentation I referred to so you can understand which getmail parameters you need.

Related Question