Easy synchronization of email between two machines w/ Thunderbird
Category: Blog

Have you ever wanted to synchronize email between two machines and been disgusted at the lack of options to truly synchronize all mail? Of course there are ways to do it easily between a PDA and a desktop machine, but between a laptop and a desktop there aren’t many options (let alone good ones). Over the years I have tried a combination of things like IMAP, rsync, commercial apps, etc. and never found anything which wasn’t more trouble than it was worth. Today I had a surprisingly simple idea which so far is working fantastically, so here’s the info so you can do the same.

First step is to configure Thunderbird on both machines to check the same pop account. If you need help with this step, then you probably should stop now. When configuring the pop account, check the box which says “leave mail on server” and then check the box which says “delete mail after ___ days”. Set the number of days to the maximum number of days which either machine could go without checking mail (two days seemed reasonable in my case). All of this should seem pretty unoriginal at this point and might work for some people. The issue I had was how to share my sent email between both machines. Fortunately, I found an option in Firefox which makes all of that easily possible. When viewing the email account settings, you should see an option in the left side which says “Copies & Folders”. There, you will see an option which says “When sending email, automatically BCC these addresses”. Click on that option and type in your email address in the box to BCC to. Now all email you send out will be automatically BCC’d back to yourself without any further work. After doing this, we now need to make sure the incoming BCC’d email gets put into the Sent mail folder. We do this by setting up two new rules, the first rule will move mail sent by the other machine into your sent mail folder on this machine, the other will delete the duplicate email received by the local machine which is already in the sent items folder. You could of course uncheck the option in the account setup which saves a copy automatically in the sent items folder, but I didn’t want to do that because if something failed on the MTA, I would then loose my copy of a sent email (which isn’t acceptable to me). The first rule is setup to match on Return-Path being the return path which matches your email address and the user agent string of the opposite machine. My machines have different User-Agent headers (different OS’s), but if your’s doesn’t then you will need something else unique in the headers between both machines. For the actions, you would want to move the email to the sent items folder, mark it as read, and delete it from the pop server (as the other machine already has it in it’s sent items folder anyway). The second rule will match on the same criteria, only with the user agent of the local machine instead of the other machine. The actions for this rule will simply mark it as read and then delete it (putting it in the trash folder). After setting up the rules on both machines, any email sent by one or the other machine will now show up in the sent items on both. Although nothing in these instructions is revolutionary or ground breaking, it does work very well for keeping mail synchronized between two machines without requiring any additional software. If you have any questions or know of any other methods, please feel free to leave a comment.

15 Responses to “Easy synchronization of email between two machines w/ Thunderbird”

  1. soccaj says:

    Why not using webmail like gmail or yahoo mail. You don’t have to synchronise at all

  2. Jeremy says:

    Two reasons behind that actually.

    1.) This is my Yahoo work email so Gmail wouldn’t work. Yahoo mail would sorta work, but it doesn’t support subfolders (neither does Gmail) and I have a very rigidly designed mail organization system.

    2.) I wanted to be able to read my mail even when I didn’t have an internet connection (like when I am on a plane).

  3. Pat says:

    This looks like a very neat solution and will meet my needs perfectly. Not revolutionary or groundbreaking? It’s a pretty creative use of available resources – and can’t be emulated in Outlook – at least I can’t find a way to automatically bcc an address! So I’ll give Thunderbird a go… Thanks!

  4. [...] you are using Thunderbird, there isn’t really anything notable available. However, Jeremy Johnstone posted on his site a unique way of getting the job done without using any special software. His method, in short, [...]

  5. FYI, I have created Thundercat, a .NET 2.0/Mono 1.9 application to synchronize mbox mail files. Thundercat is heavily tested with Thunderbird mail files and is freely available from: http://thundercat.dpant.com. The website contains all technical information, too.

    Please feel free to try Thundercat out and let me know of any shortcomings / bugs.

    Thank you very much.

    • Nishant says:

      I will certainly try to use your application. BUt the site is not opening. So please check on it and send me a working url

  6. Stuart Elder says:

    Brilliant Jeremy! Just what I’ve been looking for, and oh so simple.

    Many thanks.


  7. Gary Wilson says:

    http://thundercat.dpant.com – doesn’t load as a website

  8. jackie says:

    this is exactly what I am looking for!! thanks for posting a solution that is simple and free!!

  9. Nishant says:

    Your article for syncing Thunderbird between 2 machines is really great. I have followed the steps as designed by you, but I am facing a strange problem in using Thunderbird. All the mails downloaded on 1 machine is not downloaded to the second machine. And due to this I am forced to use just 1 email client all the time. Please suggest me a way to overcome this problem.

  10. jackie says:

    So far this works well but I still can’t figure a way to make the unique header to separate which email is from which computer. Anyone has a workaround?

    • Zélito says:

      @jackie: You could try using info from : http://kb.mozillazine.org/Custom_headers#Add_custom_headers

      So that you can set a custom header to be sent along with every e-mail, and so, you set a different value for every computer you use. Then you can set the filter to check this custom header and look for the values you set.

      To know how to add new preferences: http://email.about.com/od/mozillathunderbirdtips/qt/Add_an_Arbitrary_Custom_Header_to_Mozilla_Thunderbird.htm

      I have tested this and it is working under Thunderbird 3.04 / Linux.

    • WouterB says:

      Had the same problem because I have the same User-Agent on both machines. But I found a workaround! My solution is to tag the mail by a (new) personal tag. This tag is different on both machines. It’s possible to let TB automatically tag a new mail. This is done by editing the Config Editor as follows :
      1. Edit Preference Name ‘mailnews.customHeaders’ giving it the value ‘X-Mozilla-Keys: Reply-To’ ; this way you have both Reply-To and tags (represented by X-Mozilla-Keys) as criteria for your message filter. Btw you only need ‘X-Mozilla-Keys’ in TB2 for in TB3 a standard criterium Tags exists in the latter. The Reply-To criterium you need to identify the email is sent by you and not someone else.
      2. Create 2 new Preference Names for each id (=account)
      ‘mail.identity.id1.headers’ with string value ‘mozilla-keys’ (choose the appropriate id#)
      ‘mail.identity.id1.header.mozilla-keys’ with string value ‘X-Mozilla-Keys:yourtagname’
      For the 2 machines ‘yourtagname’ must of course be different. Don’t forget that this user tag must also actually exist in TB: you have to create it. I just tested it and it works flawlessly!

  11. Zélito says:

    Thanks a lot for the method Jeremy! It’s working even with computers with the same user-agent, using a custom header for distinguish between them.

  12. Joeyhealy says:

    He j tan so much. I am just having trouble with the sent mails setup for outlook. I am not sure which rules to use.

Leave a Comment

Spam Protection by WP-SpamFree