I have an e-mail server configured to save my mail in ~/Maildir on an account that is available over ssh. I'd like to keep emailserver:~/Maildir in a two-way sync with laptop:~/Mail/private essentially creating a poor man's IMAP — without setting up and maintaining an actual IMAP server. Is it an appropriate use of git-annex or would another tool be more fitting? And how do I go about doing it? I'd like to sync the files, the content, not just information about the files or other meta-data.
I tried setting it up with the webUI to the assistant but it only offers encrypted storage[1] on the remote server. I looked into setting it up manually but "git-annex does not notice when files are added to remote rsync repositories."[2]
[1] http://git-annex.branchable.com/bugs/Remote_repositories_have_to_be_setup_encrypted/
[2] from comments on http://git-annex.branchable.com/special_remotes/rsync/
I'd say that git-annex is the wrong tool.
OfflineIMAP (http://offlineimap.org) is simple to set up, is easy to secure over ssh and does exactly what you want.
From my massive amount of googling, i.e. 2min, apparently mbsync (http://isync.sourceforge.net/mbsync.html) is good too.
I've never used it, so YMMV.
That's what I thought. OK, so how do I do it? Should I set up this rsync special remote and run sync every once in a while. When starting the e-mail client for example?
You can either keep running 2 webapps paired using xmpp running all the time that gives you push like notifications or if you are ok with syncing every once in a while you can have a check mail script that adds files on the server commits them then calls git annex sync locally,
should do the trick. The latter method you just need to annex repos no encrypted third repo. Just init your git annex repo on the server and clone on the laptop thats it.
I don't feel that git-annex is the best thing to use for this. Maildir has some specific semantics for the filenames used in it that let imap clients resolve inconsistencies, such as a message that was read on machine A, and deleted on machine B. git-annex is unlikely to work as well.
However, I have to say that the very beginning of this thread has a wrong statement in it.
If you install git and git-annex on your remote server, the git-annex assistant will detect this, and offer the choice between a regular git repository, and encrypted storage. If you don't have them installed, it tells you you don't, offers to let you retry once you do install them, and offers encrypted storage as the only option that works given what's installed on the server.
(Also, the bug you linked to in [1] has nothing at all to do with what you were talking about.)
Hi,
I have a question quite similar, but for a different purpose. I use OfflineImap for imap synchronisation, but in my current situation, I travel a lot between two places: one connected to the Internet and the other not connected.
When I am connected to the Internet, I may synchronize mails, then I rsync my ~/Mail directory to a usb key so that I have access to them in the place without connection. The mails filenames may be changed as Joeyh mentioned while I read or delete them. I rsync them back to the usb key before going back to the place with Internet connection, where the OfflineImap synchronization may occur.
This solution, with rsynced key, works well. But I would love a history of what was done with file names and may be able to retrieve an old mail.
I figured out that that the git annex was a really good solution for that.
The main drawback from my point of view is that I have around 100 000 mails (some would say that's "Not much mail"), and I am afraid that git will be quite slow with that amount of files.
Did anyone experience an annexed repository with so many items it in?
Best