unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Chris Coutinho <chrisbcoutinho@gmail.com>
To: notmuch@notmuchmail.org
Subject: Re: notmuch over ssh
Date: Wed, 10 Feb 2021 12:35:32 +0100	[thread overview]
Message-ID: <f6a546760fa7c6340a8ba357e1483554e5d6915e.camel@gmail.com> (raw)
In-Reply-To: <m2zh0cyz54.fsf@guru.guru-group.fi>



On Wed, 2021-02-10 at 12:51 +0200, Tomi Ollila wrote:
> 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
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

Have you tried mounting the notmuch database locally using something like sshfs?
I wonder if that's a safer option than all the string escaping you're doing
here.

On the other hand, your network connection would need to be fast enough to allow
this kind of access, and the notmuch versions installed on either machine need
to be compatible.

Chris\r

      reply	other threads:[~2021-02-10 11:35 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
2021-02-10 11:35   ` Chris Coutinho [this message]

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=f6a546760fa7c6340a8ba357e1483554e5d6915e.camel@gmail.com \
    --to=chrisbcoutinho@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).