From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kK7RK666I2CESwAA0tVLHw (envelope-from ) for ; Wed, 10 Feb 2021 10:51:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +O+BJ666I2D4agAAB5/wlQ (envelope-from ) for ; Wed, 10 Feb 2021 10:51:26 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 102C49403E6 for ; Wed, 10 Feb 2021 10:51:26 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9E2001FD68; Wed, 10 Feb 2021 05:51:15 -0500 (EST) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 812DB1FBFA for ; Wed, 10 Feb 2021 05:51:12 -0500 (EST) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 925801B00107; Wed, 10 Feb 2021 12:51:06 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1612954266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RI1R2kxjWAjNYm9uSgENPl9EaDgKqgXgMHcSzD8WcpA=; b=OYn86QGE1X6c7k4pNCi0/Eh9M4hK9ogaeOtljNPlcM6J/ICCkTXnRphsCSXuau1k1w/3lh 9tWHbOVfwUEHbuQ+lDRgrNDCa4WIR5qEC0xGFY0OfuU2tnnt19okTLWtZjFpC0Azb8lAC3 EvUw+1CXPKQSQq2GUR8Gz2JleqLPoEhJ70tgBudidFLVYQvZEyj/WZ0gmownLBOSF1TCgz +5IF5QTaPQOj26/3GqZPGo9CO5hWwh5648P3mmL00u1i0YLeQspLgnpYXMyh+Q1k0UMAv1 gmgm5V/5ldtX9T3SiT6U7OP4NAymwxavjl4JZBDN2CuD4o/f8/fqI8AgvdvFBA== From: Tomi Ollila To: Keegan Carruthers-Smith , notmuch@notmuchmail.org Subject: Re: notmuch over ssh In-Reply-To: References: User-Agent: Notmuch/0.31.3+85~g92bd77f (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1612954266; a=rsa-sha256; cv=none; b=MMlq6o2lM3uf1wZLezUWu9GTcPb1nh33b3xQO7InkLx3wYvbIEtmlD3bA+Korldr15sCZL XjTIKdhg81/RnSwJIFrgDZ3IXQv5v2yzwFQA73wgYmQwKUfkHuRnWbGtj+/kTmwUiF/NCA kFYMlWNqdDEzoPeyNKtL1givjN6xQAVJB/rKdTEgrNh/lDGpzksmmqL26dlG8KesLfyeFL wuoO0bHO85ANUlXv+2f3jSJjOffHGZzT6zizOO6Vyp+mwQF8Ja6KIgejnRRf7jzYjb4Ya5 o34aRqDO6tFSOBNje+kOxO28uG0YEzgXN5COE7BjtTXrtPDjqrHaxJfw7hk2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1612954266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RI1R2kxjWAjNYm9uSgENPl9EaDgKqgXgMHcSzD8WcpA=; b=OHQ1RxYU7AYACX2PETDAyqV2XnHqI+SwFVJuESycJkVn+nSegTvGr+B+CJPsSHTLhQ9456 ZfvYPPoxA2B5jEWwdH9NK3al9JozJJdrMO+OJlOoekMoBKQntXTcNUISL7hxjdcy/rVK+h M+jBVpGIkRZeTSI09zLdXUUPXLuezmIZYVCTpFJ6QLie4kjJY+Vm61oRggvhIDvAgQV08D J+YpueLYRf62kftILpGlCaW83oRJxdOvSTSEyfzn7fw68mFwn6nHHNCHTOq7dcCt9mUWt9 DUL0a9oH+FfSwMRQp+nz2iBXV1SAv26Ax0GfplR5zjBN7/pV7KNnJiLDV0IjzA== Message-ID-Hash: RUAMOOCLVAPNSXZWZPD7AG7DSA45LUP5 X-Message-ID-Hash: RUAMOOCLVAPNSXZWZPD7AG7DSA45LUP5 X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=OYn86QGE; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 102C49403E6 X-Spam-Score: 2.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5uZ9HEuLRDHm On Wed, Feb 10 2021, Keegan Carruthers-Smith wrote: > Hello. > > Thought I'd share a hack I've been using recently. I have my > notmuch database on another machine. I wanted to access it via my > local emacs session. I didn't want to ssh in to the machine or > sync the data to another machine. I realised all communication is > done via the notmuch binary, so I wrote a wrapper script which > runs notmuch via ssh: Good stuff ! > > #!/usr/bin/env bash args=() for var in "$@" do > args+=($(printf '%q' "$var")) > done exec ssh real.local -- notmuch "${args[@]}" In https://notmuchmail.org/remoteusage/ there is an alternative !/bin/bash printf -v ARGS "%q " "$@" exec ssh notmuch notmuch ${ARGS} (which fork(2)s zero times...) And then there is my alternative at: https://github.com/domo141/nottoomuch/blob/master/nottoomuch-remote.rst (now that I posted that I have to check if it has rotted in last 4 years ;) Tomi > > Note I have hardcoded the remote (real.local). I also needed to > escape arguments since the remote shell had a tendancy to > interpret them. This escaping isn't fullproof, but has been > working so far. > > I put the above script on my PATH as "notmuch", and emacs > magically uses it. Alternatively you could set the notmuch-command > to point to the above shell script. > > Cheers, > Keegan