--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 789AA431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 3 Apr 2012 09:33:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id fcw2LjaHgHEj for <notmuch@notmuchmail.org>;\r
+ Tue, 3 Apr 2012 09:33:06 -0700 (PDT)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+ [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 732D5431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 3 Apr 2012 09:33:06 -0700 (PDT)\r
+Received: by bkwj4 with SMTP id j4so3896363bkw.26\r
+ for <notmuch@notmuchmail.org>; Tue, 03 Apr 2012 09:33:03 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:date:message-id:mime-version\r
+ :content-type:x-gm-message-state;\r
+ bh=O2+SEOd7xYdYl5iW1RJOTJzrwB5YTyHE2E+BJKLBcWA=;\r
+ b=PppV12VYSl4b1YsDBRovOKAqis34yO3BCLeRXevno5LORcKctQgcmPbUACgz1Xh3fK\r
+ MxZSgmcX5079CpXevnGZWPj8GpBsl56Nr/UDIRcekQ+JUfO7XtgI87BbJXg8yOHWgAIB\r
+ 6Mbuu153gvP4JWd+T+ofYePKZpD5j4GDe+CeBYJz2pcZC3mY7tnudWsovyyskSSBqkPY\r
+ /Z/hxwM6JQBEfW2KKBOzNn+VnQK9hRIJ9uUS+6FMAXCBs7fQqNquacM+YXDtekhgA2u+\r
+ YUsqYlyysVogc6EeXI2CNw4FCGpHDfq9jVs5nUmt4Uz/5ROZCW4Nt5XvfXYG9+hnqhJw\r
+ z0Hg==\r
+Received: by 10.205.132.145 with SMTP id hu17mr5697850bkc.66.1333470783429;\r
+ Tue, 03 Apr 2012 09:33:03 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe4fdc00-105.dhcp.inet.fi.\r
+ [80.220.79.105])\r
+ by mx.google.com with ESMTPS id x4sm47143708bkv.8.2012.04.03.09.32.59\r
+ (version=SSLv3 cipher=OTHER); Tue, 03 Apr 2012 09:33:02 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Jacek Generowicz <jacek.generowicz@cern.ch>, notmuch@notmuchmail.org\r
+Subject: Re: notmuch-poll and OfflineIMAP\r
+In-Reply-To: <aaf33fc5-d266-45d1-9bad-e675fa6a0b84@CERNFE22.cern.ch>\r
+References: <aaf33fc5-d266-45d1-9bad-e675fa6a0b84@CERNFE22.cern.ch>User-Agent:\r
+ Notmuch/0.12+81~g839a805 (http://notmuchmail.org) Emacs/23.3.1\r
+ (i686-pc-linux-gnu)\r
+Date: Tue, 03 Apr 2012 19:32:57 +0300\r
+Message-ID: <87ty10ai86.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQnDum3T8uF41yonNkD+PUciSFcqZzkqQaamZz12yAwE6M/U3UtXLppc20U7pzxP/qqbEkwG\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 03 Apr 2012 16:33:08 -0000\r
+\r
+Jacek Generowicz <jacek.generowicz@cern.ch> writes:\r
+\r
+> Hello,\r
+>\r
+> Would you have any advice on how to construct a notmuch-poll script\r
+> that would work well in concert with OfflineIMAP? In particlular, how\r
+> can you avoid having to re-issue the IMAP account passwords?\r
+>\r
+> The OfflineIMAP docs state that SIGUSR1 forces an immediate resync of\r
+> all accounts, so something based around\r
+>\r
+> kill -SIGUSR1 `cat ~/.offlineimap/pid`\r
+>\r
+> or\r
+>\r
+> pkill -SIGUSR1 -u `whoami` offlineimap\r
+>\r
+> (with an already-running OfflineIMAP process in autorefresh mode)\r
+> could work, but it's not clear to me how to discover when the resync\r
+> is done, and sleeping for an arbitrary time before calling 'notmuch\r
+> new' seems unsatisfactory.\r
+>\r
+> Any words of wisdom?\r
+\r
+Offlineimap supports running hooks after syncing. Check if SIGUSR1 does\r
+that too. Then you could run notmuch new in the post sync hook.\r
+\r
+Also, notmuch new supports pre-new and post-new hooks. You could start\r
+or SIGUSR1 offlineimap in the pre-new hook. See man notmuch-hooks for\r
+details.\r
+\r
+\r
+HTH,\r
+Jani.\r