Re: notmuch-poll and OfflineIMAP

Subject: Re: notmuch-poll and OfflineIMAP

Date: Tue, 03 Apr 2012 19:32:57 +0300

To: Jacek Generowicz, notmuch@notmuchmail.org

Cc:

From: Jani Nikula


Jacek Generowicz <jacek.generowicz@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.

Thread: