You are not logged in.

#1 2010-11-07 03:34:18

lpb612
Member
Registered: 2009-09-29
Posts: 16

Alternative to offlineimap

I have my mails on an IMAP server and I need to access mail from both school and home. I use mutt, which supports IMAP but using its own IMAP support is quite slow. For some time I have been using offlineimap and I was quite happy with it. There had been some cases of it crashing. But no mail was ever lost. I wrote a script that checks for running Offlineimap every few minutes and if it stops, restarts it.

Recently, however, Offlineimap has become less stable. Still no mails are lost, but on one occassion, it runs at CPU 114% (I have two CPUs). So I have been thinking of replacing it, given the fact that it is now no longer maintained. I am reporting to all what I am now using, which seems as good as the Offlineimap+mutt setup.

What I use is getmail+syncmaildir. The flow is the following:

1. I will use the school machine to "getmail" from the IMAP server and store it locally at school as Maildir. This is run using cron every few minutes. The emails are kepted at the server. Only "new" (not downloaded) mails are "getmail"ed each time.

2. At home, I use syncmaildir (Sync Mail Dir) to sync the home Maildir with the school machine via ssh. I also download (rsync) the oldmail-mailserver file so that if necessary, I can download the new emails directly from IMAP server.

Most of the time, this should be sufficient. I envision that if some day the school machine breaks, I will have the mails at home as a backup. And if I am travelling, then I can download the new mails directly from the server.

So far, after a few hours of testing, everything looks fine. I thought I'd share this setup with you in case you are also thinking of moving away from Offlineimap.

I read mails as usual (like everything is local) at school. Then at home, I will run "mail-update" or "mu" (see below .bashrc) before reading/replying emails and and "mu" again after. (This can be cron'ed but I think it is already short enough).

Any comments or thoughts would be welcome. I hope someone also find this useful. One last thing, the folders under Maildir should not have space in them -- or syncmaildir dies. I have a Microsoft Exchange IMAP server, so I have to change
"Sent Mails" to "Sent-Mails" etc on the school machine before the first syncing. These folders were used for syncing with the IMAP server using Offlineimap, but now only sync'ed with the machine at home. Since I almost never use Exchange directly, so this should be fine.

My setup is as follows:
------------- .getmail/getmailrc ------
[retriever]
type = SimpleIMAPSSLRetriever
server = myimap.server.com
username = mylogin
password = supersecret

[destination]
type = Maildir
path = ~/Mail/INBOX/
-----------------------------------------------------

-------- .ssh/config ---
Host schoolmachine
  BatchMode yes
  Compression yes
  Hostname school.machine.edu
  User mylogin
---------------------------

------ .smd/config.default -----
SERVERNAME=schoolmachine
CLIENTNAME=homemachinename
MAILBOX="Mail/"
DEBUG=true
---------------------------------------------

--------------- .bashrc ------------
alias mu="mail-update"
mail-update(){
    echo 'pulling ...'
    smd-pull -v
    rsync -r schoolmachine:.getmail/ .getmail/
    echo 'pushing ...'
    smd-push -v
}
----------------------------------

output of "crontab -l ":

*/3 6-23 * * * getmail -qln

I have uploaded a package on AUR for syncmaildir (as I did not find it), at this location:

http://aur.archlinux.org/packages.php?ID=42691

Since I have not thoroughly tested this setup, bear in mind the risk and be careful before committing a big change.

Last edited by lpb612 (2010-11-07 03:46:39)

Offline

#2 2010-11-07 05:21:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Alternative to offlineimap

Nice one - I'll check this out.

Also, moving to Community Contributions


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-09-21 20:03:56

lpb612
Member
Registered: 2009-09-29
Posts: 16

Re: Alternative to offlineimap

Actually, recently I have started using isync/mbsync, which I think is a better solution than the other combinations (offlineimap, or syncmaildir+getmail). It can do anything that I want to do with offlineimap, and so far has been quite reliable. So I recommend isync/mbsync highly to any one who wants to sync offline Maildir with IMAP servier. I have tested multiple clients syncing with a single IMAP server - there is no problem.

Offline

#4 2013-04-18 12:10:23

whilealive
Member
Registered: 2012-09-04
Posts: 17

Re: Alternative to offlineimap

I've switched from offlineimap to mbsync, too. On my laptop, it's so much faster, couldn't believe it. I had some problems with the non-git AUR version where the "pattern"-option didn't work with my gmail account. It just never synced all the [Gmail]... folders. Anyway, the current git-Version works perfectly. Expecially the "flatten"-option is very helpful in order to prevent maildir subfolders.

Offline

Board footer

Powered by FluxBB