Ivan Tomica

Replacing OfflineIMAP with MBSync (isync)

For most of my private email needs I prefer to use Mu4e within Emacs. It is a module of Emacs which basically searches through Mu index file.

Naturally, to be able to index something, you first need to fetch it. In this case “it” are email messages from the server, or, my mailbox if you wish. For this particular purpose OfflineIMAP utility has served me well over the time, and to be honest, my needs are quite simple:

  • sync messages locally to some folder
  • sync changes of that folder back to the server

What I’ve noticed lately though is that every sync, even with quick option turned on, takes around 8-10 seconds with OfflineIMAP. That prompted me to explore MBSync to see how long does it take to sync messages. Lo and behold:

[ivan@bequiet ~]$ time mbsync tomica 
C: 1/1  B: 7/7  M: +0/0 *0/0 #0/0  S: +7/7 *0/0 #0/0

real	0m2.109s
user	0m0.061s
sys	0m0.027s

Results are pretty much consistent across the runs.

So, since configuration was simple and pretty straight forward and as it serves my purpose well, I’m switching to it. If anybody is interested, my config is as follows:

IMAPAccount tomica
CertificateFile /etc/ssl/certs/ca-bundle.crt
PassCmd "secret-tool lookup MYEMAIL password"

MaildirStore tomica-local
Path ~/Mail/
Inbox ~/Mail/Inbox
SubFolders Verbatim

IMAPStore tomica-remote
Account tomica

Channel tomica
Master :tomica-remote:
Slave :tomica-local:
SyncState *
Patterns *
Create Both
Expunge Both

Pretty straight forward.

After switching to mbsync in mu4e I’ve noticed that I get duplicate UID error each time I perform the refile. Solution to this issue was to add:

(setq mu4e-change-filenames-when-moving t)

To my Emacs config.

Sysadmin on the everlasting journey of learning.


Leave a Reply

Your email address will not be published. Required fields are marked *