unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Keegan Carruthers-Smith <keegan.csmith@gmail.com>,
	notmuch@notmuchmail.org
Subject: Re: notmuch over ssh
Date: Wed, 10 Feb 2021 12:51:03 +0200	[thread overview]
Message-ID: <m2zh0cyz54.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <m2im70gsgg.fsf@gmail.com>

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

  reply	other threads:[~2021-02-10 10:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  9:52 notmuch over ssh Keegan Carruthers-Smith
2021-02-10 10:51 ` Tomi Ollila [this message]
2021-02-10 11:35   ` Chris Coutinho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zh0cyz54.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=keegan.csmith@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).