notmuch-poll and OfflineIMAP
Jani Nikula
jani at nikula.org
Tue Apr 3 09:32:57 PDT 2012
Jacek Generowicz <jacek.generowicz at cern.ch> writes:
> Hello,
>
> Would you have any advice on how to construct a notmuch-poll script
> that would work well in concert with OfflineIMAP? In particlular, how
> can you avoid having to re-issue the IMAP account passwords?
>
> The OfflineIMAP docs state that SIGUSR1 forces an immediate resync of
> all accounts, so something based around
>
> kill -SIGUSR1 `cat ~/.offlineimap/pid`
>
> or
>
> pkill -SIGUSR1 -u `whoami` offlineimap
>
> (with an already-running OfflineIMAP process in autorefresh mode)
> could work, but it's not clear to me how to discover when the resync
> is done, and sleeping for an arbitrary time before calling 'notmuch
> new' seems unsatisfactory.
>
> Any words of wisdom?
Offlineimap supports running hooks after syncing. Check if SIGUSR1 does
that too. Then you could run notmuch new in the post sync hook.
Also, notmuch new supports pre-new and post-new hooks. You could start
or SIGUSR1 offlineimap in the pre-new hook. See man notmuch-hooks for
details.
HTH,
Jani.
More information about the notmuch
mailing list