Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 789AA431FAE for ; Tue, 3 Apr 2012 09:33:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fcw2LjaHgHEj for ; Tue, 3 Apr 2012 09:33:06 -0700 (PDT) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 732D5431FB6 for ; Tue, 3 Apr 2012 09:33:06 -0700 (PDT) Received: by bkwj4 with SMTP id j4so3896363bkw.26 for ; Tue, 03 Apr 2012 09:33:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-type:x-gm-message-state; bh=O2+SEOd7xYdYl5iW1RJOTJzrwB5YTyHE2E+BJKLBcWA=; b=PppV12VYSl4b1YsDBRovOKAqis34yO3BCLeRXevno5LORcKctQgcmPbUACgz1Xh3fK MxZSgmcX5079CpXevnGZWPj8GpBsl56Nr/UDIRcekQ+JUfO7XtgI87BbJXg8yOHWgAIB 6Mbuu153gvP4JWd+T+ofYePKZpD5j4GDe+CeBYJz2pcZC3mY7tnudWsovyyskSSBqkPY /Z/hxwM6JQBEfW2KKBOzNn+VnQK9hRIJ9uUS+6FMAXCBs7fQqNquacM+YXDtekhgA2u+ YUsqYlyysVogc6EeXI2CNw4FCGpHDfq9jVs5nUmt4Uz/5ROZCW4Nt5XvfXYG9+hnqhJw z0Hg== Received: by 10.205.132.145 with SMTP id hu17mr5697850bkc.66.1333470783429; Tue, 03 Apr 2012 09:33:03 -0700 (PDT) Received: from localhost (dsl-hkibrasgw4-fe4fdc00-105.dhcp.inet.fi. [80.220.79.105]) by mx.google.com with ESMTPS id x4sm47143708bkv.8.2012.04.03.09.32.59 (version=SSLv3 cipher=OTHER); Tue, 03 Apr 2012 09:33:02 -0700 (PDT) From: Jani Nikula To: Jacek Generowicz , notmuch@notmuchmail.org Subject: Re: notmuch-poll and OfflineIMAP In-Reply-To: References: User-Agent: Notmuch/0.12+81~g839a805 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Tue, 03 Apr 2012 19:32:57 +0300 Message-ID: <87ty10ai86.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQnDum3T8uF41yonNkD+PUciSFcqZzkqQaamZz12yAwE6M/U3UtXLppc20U7pzxP/qqbEkwG X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2012 16:33:08 -0000 Jacek Generowicz 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.