1 Return-Path: <sojkam1@fel.cvut.cz>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id BDB25431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 4 Feb 2011 23:38:38 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id noL2nvOFdrwv for <notmuch@notmuchmail.org>;
\r
16 Fri, 4 Feb 2011 23:38:37 -0800 (PST)
\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 91FA0431FB5
\r
19 for <notmuch@notmuchmail.org>; Fri, 4 Feb 2011 23:38:37 -0800 (PST)
\r
20 Received: from localhost (unknown [192.168.200.4])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id C19F819F3390;
\r
22 Sat, 5 Feb 2011 08:38:35 +0100 (CET)
\r
23 X-Virus-Scanned: IMAP AMAVIS
\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])
\r
25 by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,
\r
27 with ESMTP id 39pCIaKKc5yf; Sat, 5 Feb 2011 08:38:34 +0100 (CET)
\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])
\r
29 by max.feld.cvut.cz (Postfix) with ESMTP id 32DD219F338E;
\r
30 Sat, 5 Feb 2011 08:38:34 +0100 (CET)
\r
31 Received: from steelpick.2x.cz (note-sojka.felk.cvut.cz [147.32.86.30])
\r
32 (Authenticated sender: sojkam1)
\r
33 by imap.feld.cvut.cz (Postfix) with ESMTPSA id 2F37215C031;
\r
34 Sat, 5 Feb 2011 08:38:33 +0100 (CET)
\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.72)
\r
36 (envelope-from <sojkam1@fel.cvut.cz>)
\r
37 id 1Plcj3-00077w-Hx; Sat, 05 Feb 2011 08:38:33 +0100
\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
39 To: Jesse Rosenthal <jrosenthal@jhu.edu>, notmuch@notmuchmail.org
\r
40 Subject: Re: Remote usage script updated
\r
41 In-Reply-To: <87oc72xs35.fsf@lucky.home>
\r
42 References: <87oc72xs35.fsf@lucky.home>
\r
43 User-Agent: Notmuch/0.5-103-g1253785 (http://notmuchmail.org) Emacs/23.2.1
\r
44 (x86_64-pc-linux-gnu)
\r
45 Date: Sat, 05 Feb 2011 08:38:33 +0100
\r
46 Message-ID: <87aaibylqe.fsf@steelpick.2x.cz>
\r
48 Content-Type: text/plain; charset=us-ascii
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Sat, 05 Feb 2011 07:38:38 -0000
\r
63 On Thu, 27 Jan 2011, Jesse Rosenthal wrote:
\r
66 > Just a note to say that I finally got around to updating the remote
\r
67 > usage script on the wiki to what I'm using now. With "--format=raw" in,
\r
68 > it's all pretty straightforward.
\r
72 thanks for this. I wanted to do this since the --format=raw was merged,
\r
73 but didn't find the time for it. I have a few comments:
\r
75 > The only things the script does now are:
\r
77 > 1. Produces a slight pause in the "notmuch show" output to avoid that
\r
78 > weird bug where emacs leaves off every tenth message or so.
\r
80 I added a comment to the script to explain the sleep there. Otherwise,
\r
81 people may delete the command because they think it is not needed.
\r
84 > 2. Locally caches raw messages (i.e. when --format=raw) is called. This
\r
85 > usually happens when getting attachments, so this is a nice way to
\r
86 > avoid having to download large attachments repeatedly.
\r
88 This is a good idea.
\r
90 > Note this just caches based on msg-id (or a hash thereof, to avoid
\r
91 > strange characters in file names). That means that if an attachment
\r
92 > is deleted on the server, the cache will be out of date. An easy way
\r
93 > to fix this would be to make the cache file name a concatenation of
\r
94 > the msg-id hash (check that first) and the hash of the actual message
\r
95 > (check that if the msg-id hash is there). I might put this in in the
\r
96 > future, especially if anyone else is using the script.
\r
98 > 3. Escapes dollar signs in the msg-id to make shell-quoting over ssh
\r
101 I think that quoting with
\r
102 printf -v args "%q " "$@"
\r
103 instead of sed would work more reliably (see bash(1)).
\r
105 > I've actually switched over to keeping my messages on my IMAP server and
\r
106 > using this remote script on all of my computers. It avoids any need for
\r
107 > syncing. It's been working very well for me so far.
\r
109 > A future feature might be to integrate the ControlMaster feature of
\r
110 > openssh into the script, instead of having to open a connection
\r
111 > manually, but there are some complications there (dead sockets still
\r
112 > around if you go offline, etc.).
\r
114 In another project I worked around the dead sockets this way:
\r
117 local socket="$HOME/.ssh/cangw-connection"
\r
119 if [[ ! -S $socket ]] || ! ssh -x -a -S $socket root@192.168.2.3 true; then
\r
120 # Create master connection to speed up subsequent commands.
\r
121 ssh -N -f -M -S $socket root@192.168.2.3 >/dev/null 2>&1
\r
123 ssh -x -a -S $socket root@192.168.2.3 "$@"
\r
126 I guess this should work even for notmuch.
\r