offlineimaprc, mostly from Steve Losh's setup.