mail sharing/sync between linux & windows
April 18, 2008 by gopalkoduri
Note : All the future posts and even updates to existing ones, when it comes to howtos will take place at tidbits. There will NOT be any updates here. So, kindly go here to find recent version of this.
The number of people using dual boot systems is increasing exponentially. And one of the most used thing across them is mail client! Now, if there is some way out to use the same configurations, mail folders for clients running on both operating systems, oh! that would save lot of headache. Be it mozilla thunderbird, evolution or whatever the client that can be installed and run on both the platforms, here is a way out.. I will take thunderbird as the client, Vista as windows platform, Ubuntu as linux platform.
say you are in linux and have mounted windows partition @ /media/win and say you have all the settings and mail in windows. In the following steps, replace the text in angled braces “<>”, with appropriate name.
step 1: just start thunderbird client in linux without creating any accounts. just start it and close it. this is to create the data folders in your home.
step 2: cp /media/win/Users/<username>/AppData/Roaming/Thunderbird/Profiles/<profilename>.default/* ~/.mozilla-thunderbird/<profilename>.default/
now we have two copies of our mail; what we need is, whenever we boot linux, the linux’s copy should be updated and whenever we shutdown/reboot, the window’s copy should be updated. this keeps those folders in sync. to do this, the following are the steps.
step 3: make two scripts, which sync those two copies.
first one is as follows, to run at startup. say this is mailstart.sh
#!/bin/bash
rsync -avz /media/sda1/Users/gopi/AppData/Roaming/Thunderbird/Profiles/<profile>.default/ /home/gopi/.mozilla-thunderbird/<profile>.default/
second script is as follows, to run on halt/reboot. say this is mailshut.sh
#!/bin/bash
rsync -avz /home/gopi/.mozilla-thunderbird/<profile>.default/ /media/sda1/Users/gopi/AppData/Roaming/Thunderbird/Profiles/<profile>.default/
now execute the following steps to set them up on startup and shutdown.
sudo cp mailstart.sh mailshut.sh /etc/init.d/
sudo ln -s /etc/init.d/mailshut.sh /etc/rc0.d/K10mailshut.sh
sudo ln -s /etc/init.d/mailshut.sh /etc/rc6.d/K10mailshut.sh
sudo update-rc.d -f mailstart.sh start 2 3 4 5 .
don’t forget the dot on last line!
Thats it! If you have got any issues with above mentioned procedure, do let me know.
update : Incase you want to use this with clients on two different systems, the script looks like this..
rsync -avz /home/user/.mozilla-thunderbird/<profile>.default/ <user@otherhost>:/home/user/.mozilla-thunderbird/<profile>.default/



Though I have stopped using the other OS long long time back … it may be good idea to sync mails between my two linux desktops
The above would look much more beautiful if you can post the commands in html code blocks.
thanks kulbir, re-formatted it with code blocks..
I have been using thunderbird both on windows and fedora for a while now and I must say that there is no need to update the data files in windows and linux each time we login…..Instead, the account settings in thunderbird in linux and windows can be customized to share the same data file on a shared partition…..here’s a detailed description…..
http://ubuntuforums.org/showthread.php?t=203524…...
this can be done for firefox profiles too….
hey kinshul, that fails on few cases like the one with me. I have ntfs partition for Vista and thunderbird in linux gives errors as it is failing to set few attributes on files on tht partition, where as rsync could atleast update the files, even if it couldn’t actually set proper attrbs.
I also tried the other way of writing to linux partition from windows and it’s a real hell to wait while linux checks for errors on the partition which windows has written, as current s/ws in windows provide write support, only just in case.
This is one among other ways to be on safe side..
one other benefit is if you have the clients on different systems, the script given can be modified to update those copies and keep them in sync.
hmm…rsync sure does the job and if the clients on two different systems have to use the same data files then it seems to be a nice solution…i have a shared fat32 partition and the shared profile method works neatly there…