unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch-poll and OfflineIMAP
@ 2012-04-03 15:27 Jacek Generowicz
  2012-04-03 16:32 ` Jani Nikula
  2012-04-03 20:48 ` Adam Wolfe Gordon
  0 siblings, 2 replies; 5+ messages in thread
From: Jacek Generowicz @ 2012-04-03 15:27 UTC (permalink / raw)
  To: notmuch

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?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-poll and OfflineIMAP
  2012-04-03 15:27 notmuch-poll and OfflineIMAP Jacek Generowicz
@ 2012-04-03 16:32 ` Jani Nikula
  2012-04-08 22:20   ` Sebastian Spaeth
  2012-04-03 20:48 ` Adam Wolfe Gordon
  1 sibling, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2012-04-03 16:32 UTC (permalink / raw)
  To: Jacek Generowicz, notmuch

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-poll and OfflineIMAP
  2012-04-03 15:27 notmuch-poll and OfflineIMAP Jacek Generowicz
  2012-04-03 16:32 ` Jani Nikula
@ 2012-04-03 20:48 ` Adam Wolfe Gordon
  2012-04-08 22:26   ` Sebastian Spaeth
  1 sibling, 1 reply; 5+ messages in thread
From: Adam Wolfe Gordon @ 2012-04-03 20:48 UTC (permalink / raw)
  To: Jacek Generowicz; +Cc: notmuch

Hi Jacek,

On Tue, Apr 3, 2012 at 09:27, Jacek Generowicz <jacek.generowicz@cern.ch> wrote:
> 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?

I run offlineimap in autorefresh mode (with IDLE too, actually) and
use a script based on inotify to update notmuch whenever new mail
comes in: https://gist.github.com/1952483 . It sounds like some
variant of this would probably work for you.

As an added bonus, I have my post-new script run emacsclient -n -e
'(notmuch-hello-update t)', so if I flip to my mail desktop I can see
right away if there's new mail.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-poll and OfflineIMAP
  2012-04-03 16:32 ` Jani Nikula
@ 2012-04-08 22:20   ` Sebastian Spaeth
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Spaeth @ 2012-04-08 22:20 UTC (permalink / raw)
  To: Jani Nikula, Jacek Generowicz, notmuch

Jani Nikula <jani@nikula.org> wrote:

>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?

>> 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

Offlineimap hooks work nicely for running notmuch scripts, i run it this way. Sending Sigusr1 will invoke that too, but I don't think that would be needed. It's mostly for peole running OfflineMap as a daemon....

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-poll and OfflineIMAP
  2012-04-03 20:48 ` Adam Wolfe Gordon
@ 2012-04-08 22:26   ` Sebastian Spaeth
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Spaeth @ 2012-04-08 22:26 UTC (permalink / raw)
  To: Adam Wolfe Gordon, Jacek Generowicz; +Cc: notmuch

Adam Wolfe Gordon <awg+notmuch@xvx.ca> wrote:
>
>I run offlineimap in autorefresh mode (with IDLE too, actually) and
>use a script based on inotify to update notmuch whenever new mail
>comes in: https://gist.github.com/1952483 . It sounds like some
>variant of this would probably work for you.

I actually plan to add new-message-hooks to offlineimap fairly soon.

Sebastian

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-08 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-03 15:27 notmuch-poll and OfflineIMAP Jacek Generowicz
2012-04-03 16:32 ` Jani Nikula
2012-04-08 22:20   ` Sebastian Spaeth
2012-04-03 20:48 ` Adam Wolfe Gordon
2012-04-08 22:26   ` Sebastian Spaeth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).