1 Return-Path: <bremner@unb.ca>
\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 DAA6E429E50
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 04:16:35 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\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 cMgdsqS2DBrV for <notmuch@notmuchmail.org>;
\r
16 Sat, 14 Jan 2012 04:16:35 -0800 (PST)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 0E4CC429E4E
\r
21 for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 04:16:34 -0800 (PST)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034076032.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.76.32]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0ECGU1m003694
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sat, 14 Jan 2012 08:16:31 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)
\r
29 (envelope-from <bremner@unb.ca>)
\r
30 id 1Rm2X8-00052m-8i; Sat, 14 Jan 2012 08:16:30 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: Pieter Praet <pieter@praet.org>
\r
33 Subject: Re: [PATCH] test: cli: getting/setting/removing config values
\r
34 In-Reply-To: <1326531476-14556-1-git-send-email-pieter@praet.org>
\r
35 References: <8739bir7do.fsf@praet.org>
\r
36 <1326531476-14556-1-git-send-email-pieter@praet.org>
\r
37 User-Agent: Notmuch/0.11 (http://notmuchmail.org) Emacs/23.3.1
\r
38 (x86_64-pc-linux-gnu)
\r
39 Date: Sat, 14 Jan 2012 08:16:30 -0400
\r
40 Message-ID: <87aa5qjx7l.fsf@zancas.localnet>
\r
42 Content-Type: text/plain; charset=us-ascii
\r
43 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Sat, 14 Jan 2012 12:16:36 -0000
\r
58 On Sat, 14 Jan 2012 09:57:56 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
59 > Full test coverage for getting, setting and removing options in
\r
60 > notmuch(1)'s config file ($NOTMUCH_CONFIG or $HOME/.notmuch-config).
\r
64 > +# FIXME: Not the most robust nor portable solution here...
\r
65 > +# Especially `hostname --domain' may have unwanted effects on
\r
66 > +# some platforms, e.g. setting your hostname to "--domain" ;)
\r
67 > +fallback_name="$(grep $(id -un) /etc/passwd | cut -d ":" -f 5 | cut -d "," -f 1)"
\r
68 > +fallback_email="$(id -un)@$(hostname).$(hostname --domain)"
\r
70 I'm not sure how portable it is, but maybe dnsdomainname would at least
\r
71 have better failure modes.
\r
73 I also wondered about using getent instead of grep.
\r