Re: Problem with draft mails when using offlineimap
[notmuch-archives.git] / 60 / cad34d40879a162459ffe6576a9533c9971186
1 Return-Path: <m.walters@qmul.ac.uk>\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 arlo.cworth.org (Postfix) with ESMTP id 5EE036DE1983\r
6  for <notmuch@notmuchmail.org>; Tue,  7 Apr 2015 00:24:57 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.688\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.688 tagged_above=-999 required=5\r
12  tests=[AWL=-0.040, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13  NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\r
15  RP_MATCHES_RCVD=-0.55, T_FREEMAIL_FORGED_FROMDOMAIN=0.01,\r
16  T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
17 Received: from arlo.cworth.org ([127.0.0.1])\r
18  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
19  with ESMTP id WTTvKfUFniH4 for <notmuch@notmuchmail.org>;\r
20  Tue,  7 Apr 2015 00:24:55 -0700 (PDT)\r
21 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
22  by arlo.cworth.org (Postfix) with ESMTPS id D84D46DE1974\r
23  for <notmuch@notmuchmail.org>; Tue,  7 Apr 2015 00:24:54 -0700 (PDT)\r
24 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
25  by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
26  (envelope-from <m.walters@qmul.ac.uk>)\r
27  id 1YfNsR-000616-L0; Tue, 07 Apr 2015 08:24:52 +0100\r
28 Received: from 188.29.19.158.threembb.co.uk ([188.29.19.158] helo=localhost)\r
29  by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
30  (envelope-from <m.walters@qmul.ac.uk>)\r
31  id 1YfNsQ-00070m-5z; Tue, 07 Apr 2015 08:24:51 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: David Bremner <david@tethera.net>, David Bremner <david@tethera.net>,\r
34  notmuch@notmuchmail.org\r
35 Subject: Re: [Patch v2 4/4] cli: add standard option processing to config and\r
36  setup\r
37 In-Reply-To: <1428322958-2887-5-git-send-email-david@tethera.net>\r
38 References: <87d23ixnr7.fsf@maritornes.cs.unb.ca>\r
39  <1428322958-2887-1-git-send-email-david@tethera.net>\r
40  <1428322958-2887-5-git-send-email-david@tethera.net>\r
41 User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
42  (x86_64-pc-linux-gnu)\r
43 Date: Tue, 07 Apr 2015 08:24:43 +0100\r
44 Message-ID: <87vbh8qu2s.fsf@qmul.ac.uk>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 X-QM-SPAM-Info: 188.29.19.158 is in Janet mirror of Spamhaus XBL;\r
48  see http://www.spamhaus.org/xbl/\r
49 X-Sender-Host-Address: 188.29.19.158\r
50 X-QM-Geographic: According to ripencc,\r
51  this message was delivered by a machine in Britain (UK) (GB).\r
52 X-QM-SPAM-Info: Sender has good ham record.  :)\r
53 X-QM-Body-MD5: 60c409073c636466411aa8b2036c8bf0 (of first 20000 bytes)\r
54 X-SpamAssassin-Score: -0.1\r
55 X-SpamAssassin-SpamBar: /\r
56 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
57  determine if it is\r
58  spam. We require at least 5.0 points to mark a message as spam.\r
59  This message scored -0.1 points.\r
60  Summary of the scoring: \r
61  *  0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider\r
62  *      (markwalters1009[at]gmail.com)\r
63  * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
64  *      domain\r
65  * -0.1 AWL AWL: Adjusted score from AWL reputation of From: address\r
66 X-QM-Scan-Virus: ClamAV says the message is clean\r
67 X-BeenThere: notmuch@notmuchmail.org\r
68 X-Mailman-Version: 2.1.18\r
69 Precedence: list\r
70 List-Id: "Use and development of the notmuch mail system."\r
71  <notmuch.notmuchmail.org>\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
73  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
75 List-Post: <mailto:notmuch@notmuchmail.org>\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
78  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
79 X-List-Received-Date: Tue, 07 Apr 2015 07:24:57 -0000\r
80 \r
81 \r
82 Hi\r
83 \r
84 On Mon, 06 Apr 2015, David Bremner <david@tethera.net> wrote:\r
85 > In particular this fixes a recently encountered bug where the\r
86 > "--config" argument to "notmuch setup" is silently ignored, which the\r
87 > unpleasant consequence of overwriting the users config file.\r
88 > ---\r
89 >  notmuch-config.c     | 16 +++++++++++++++-\r
90 >  notmuch-setup.c      | 12 ++++++++++++\r
91 >  test/random-corpus.c |  9 +++++++++\r
92 >  3 files changed, 36 insertions(+), 1 deletion(-)\r
93 >\r
94 > diff --git a/notmuch-config.c b/notmuch-config.c\r
95 > index 2d5c297..f2cd6a8 100644\r
96 > --- a/notmuch-config.c\r
97 > +++ b/notmuch-config.c\r
98 > @@ -872,8 +872,22 @@ int\r
99 >  notmuch_config_command (notmuch_config_t *config, int argc, char *argv[])\r
100 >  {\r
101 >      int ret;\r
102 > +    int opt_index;\r
103 >  \r
104 > -    argc--; argv++; /* skip subcommand argument */\r
105 > +    notmuch_opt_desc_t options[] = {\r
106 > +     { NOTMUCH_OPT_INHERIT, (void *) &notmuch_shared_options, NULL, 0, 0 },\r
107 > +     { 0, 0, 0, 0, 0 }\r
108 > +    };\r
109 > +\r
110 > +    opt_index = parse_arguments (argc, argv, options, 1);\r
111 > +    if (opt_index < 0)\r
112 > +     return EXIT_FAILURE;\r
113 > +\r
114 > +    notmuch_process_shared_options (argv[0]);\r
115 > +\r
116 > +    /* skip at least subcommand argument */\r
117 > +    argc-= opt_index;\r
118 > +    argv+= opt_index;\r
119 >  \r
120 >      if (argc < 1) {\r
121 >       fprintf (stderr, "Error: notmuch config requires at least one argument.\n");\r
122 > diff --git a/notmuch-setup.c b/notmuch-setup.c\r
123 > index 36a6171..6a020dc 100644\r
124 > --- a/notmuch-setup.c\r
125 > +++ b/notmuch-setup.c\r
126 > @@ -133,6 +133,7 @@ notmuch_setup_command (notmuch_config_t *config,\r
127 >      size_t new_tags_len;\r
128 >      const char **search_exclude_tags;\r
129 >      size_t search_exclude_tags_len;\r
130 > +    int opt_index;\r
131 >  \r
132 >  #define prompt(format, ...)                                  \\r
133 >      do {                                                     \\r
134 > @@ -145,6 +146,17 @@ notmuch_setup_command (notmuch_config_t *config,\r
135 >       chomp_newline (response);                               \\r
136 >      } while (0)\r
137 >  \r
138 > +    notmuch_opt_desc_t options[] = {\r
139 > +     { NOTMUCH_OPT_INHERIT, (void *) &notmuch_shared_options, NULL, 0, 0 },\r
140 > +     { 0, 0, 0, 0, 0 }\r
141 > +    };\r
142 > +\r
143 > +    opt_index = parse_arguments (argc, argv, options, 1);\r
144 > +    if (opt_index < 0)\r
145 > +     return EXIT_FAILURE;\r
146 > +\r
147 > +    notmuch_process_shared_options ("setup");\r
148 \r
149 Why "setup" here rather than argv[0] or similar? It seems inconsistent\r
150 with the other cases.\r
151 \r
152 Best wishes\r
153 \r
154 Mark\r
155 \r
156 \r
157 \r
158 > +\r
159 >      if (notmuch_config_is_new (config))\r
160 >       welcome_message_pre_setup ();\r
161 >  \r
162 > diff --git a/test/random-corpus.c b/test/random-corpus.c\r
163 > index 790193d..6c467bb 100644\r
164 > --- a/test/random-corpus.c\r
165 > +++ b/test/random-corpus.c\r
166 > @@ -114,6 +114,15 @@ random_utf8_string (void *ctx, size_t char_count)\r
167 >      return buf;\r
168 >  }\r
169 >  \r
170 > +/* stubs since we cannot link with notmuch.o */\r
171 > +const notmuch_opt_desc_t notmuch_shared_options[] = {\r
172 > +     { 0, 0, 0, 0, 0 }\r
173 > +};\r
174 > +\r
175 > +void\r
176 > +notmuch_process_shared_options (unused (const char *dummy))\r
177 > +{\r
178 > +}\r
179 >  \r
180 >  int\r
181 >  main (int argc, char **argv)\r
182 > -- \r
183 > 2.1.4\r
184 >\r
185 > _______________________________________________\r
186 > notmuch mailing list\r
187 > notmuch@notmuchmail.org\r
188 > http://notmuchmail.org/mailman/listinfo/notmuch\r