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 olra.theworths.org (Postfix) with ESMTP id 2BC3A431FB6
\r
6 for <notmuch@notmuchmail.org>; Thu, 28 Jun 2012 13:54:46 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id utag0Xkjg23S for <notmuch@notmuchmail.org>;
\r
17 Thu, 28 Jun 2012 13:54:45 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id ED721431FAF
\r
22 for <notmuch@notmuchmail.org>; Thu, 28 Jun 2012 13:54:44 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1SkLjb-0002eN-Cj; Thu, 28 Jun 2012 21:54:43 +0100
\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]
\r
29 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
30 (envelope-from <m.walters@qmul.ac.uk>)
\r
31 id 1SkLja-00051P-RH; Thu, 28 Jun 2012 21:54:39 +0100
\r
32 From: Mark Walters <markwalters1009@gmail.com>
\r
33 To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>, notmuch@notmuchmail.org
\r
34 Subject: Re: [RFC PATCH 10/14] new: add "scan" option
\r
35 In-Reply-To: <1340657517-6539-6-git-send-email-ethan@betacantrips.com>
\r
36 References: <1340657517-6539-1-git-send-email-ethan@betacantrips.com>
\r
37 <1340657517-6539-6-git-send-email-ethan@betacantrips.com>
\r
38 User-Agent: Notmuch/0.13.2+63~g548a9bf (http://notmuchmail.org) Emacs/23.4.1
\r
39 (x86_64-pc-linux-gnu)
\r
40 Date: Thu, 28 Jun 2012 21:54:32 +0100
\r
41 Message-ID: <87ehozma2f.fsf@qmul.ac.uk>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-Sender-Host-Address: 94.192.233.223
\r
45 X-QM-SPAM-Info: Sender has good ham record. :)
\r
46 X-QM-Body-MD5: 7856a2c025354e887455a3bf3ae18751 (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -1.8
\r
48 X-SpamAssassin-SpamBar: -
\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
51 spam. We require at least 5.0 points to mark a message as spam.
\r
52 This message scored -1.8 points.
\r
53 Summary of the scoring:
\r
54 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
56 * [138.37.6.40 listed in list.dnswl.org]
\r
57 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
58 provider * (markwalters1009[at]gmail.com)
\r
59 * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
\r
61 * 0.5 AWL AWL: From: address is in the auto white-list
\r
62 X-QM-Scan-Virus: ClamAV says the message is clean
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\r
66 List-Id: "Use and development of the notmuch mail system."
\r
67 <notmuch.notmuchmail.org>
\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
71 List-Post: <mailto:notmuch@notmuchmail.org>
\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
75 X-List-Received-Date: Thu, 28 Jun 2012 20:54:46 -0000
\r
77 On Mon, 25 Jun 2012, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
\r
78 > This is just a quick hack to get started on adding an mbox backend.
\r
80 > The fact that the default maildir is scanned "automagically" is a
\r
81 > little weird, but it doesn't do any harm unless you decide to put mail
\r
82 > there that you really don't want indexed.
\r
84 I was a bit caught out by the way this worked. I expected that I would
\r
86 scan=mbox:///full_path_of_mbox
\r
87 but instead it seems that I need to add
\r
88 scan=mbox:///full_path_of_directory_containing_the_mbox
\r
90 I am happy with either (and yours is probably easier) but it should be
\r
91 documented somewhere and I found the line
\r
92 > + "\tscan A list (separated by ';') of mail URLs to scan.\n"
\r
100 > Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
\r
102 > notmuch-client.h | 9 +++++++++
\r
103 > notmuch-config.c | 30 +++++++++++++++++++++++++++++-
\r
104 > notmuch-new.c | 18 ++++++++++++++++++
\r
105 > test/config | 1 +
\r
106 > 4 files changed, 57 insertions(+), 1 deletion(-)
\r
108 > diff --git a/notmuch-client.h b/notmuch-client.h
\r
109 > index 9b63eae..9d922fe 100644
\r
110 > --- a/notmuch-client.h
\r
111 > +++ b/notmuch-client.h
\r
112 > @@ -256,6 +256,15 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,
\r
113 > const char *new_ignore[],
\r
117 > +notmuch_config_get_new_scan (notmuch_config_t *config,
\r
118 > + size_t *length);
\r
121 > +notmuch_config_set_new_scan (notmuch_config_t *config,
\r
122 > + const char *new_scan[],
\r
123 > + size_t length);
\r
126 > notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config);
\r
128 > diff --git a/notmuch-config.c b/notmuch-config.c
\r
129 > index 3e37a2d..e9d99ea 100644
\r
130 > --- a/notmuch-config.c
\r
131 > +++ b/notmuch-config.c
\r
132 > @@ -50,7 +50,10 @@ static const char new_config_comment[] =
\r
133 > "\t that will not be searched for messages by \"notmuch new\".\n"
\r
135 > "\t NOTE: *Every* file/directory that goes by one of those names will\n"
\r
136 > - "\t be ignored, independent of its depth/location in the mail store.\n";
\r
137 > + "\t be ignored, independent of its depth/location in the mail store.\n"
\r
139 > + "\tscan A list (separated by ';') of mail URLs to scan.\n"
\r
140 > + "\t The maildir located at database.path, above, will automatically be added.\n";
\r
142 > static const char user_config_comment[] =
\r
143 > " User configuration\n"
\r
144 > @@ -113,6 +116,8 @@ struct _notmuch_config {
\r
145 > size_t new_tags_length;
\r
146 > const char **new_ignore;
\r
147 > size_t new_ignore_length;
\r
148 > + const char **new_scan;
\r
149 > + size_t new_scan_length;
\r
150 > notmuch_bool_t maildir_synchronize_flags;
\r
151 > const char **search_exclude_tags;
\r
152 > size_t search_exclude_tags_length;
\r
153 > @@ -274,6 +279,8 @@ notmuch_config_open (void *ctx,
\r
154 > config->new_tags_length = 0;
\r
155 > config->new_ignore = NULL;
\r
156 > config->new_ignore_length = 0;
\r
157 > + config->new_scan = NULL;
\r
158 > + config->new_scan_length = 0;
\r
159 > config->maildir_synchronize_flags = TRUE;
\r
160 > config->search_exclude_tags = NULL;
\r
161 > config->search_exclude_tags_length = 0;
\r
162 > @@ -375,6 +382,10 @@ notmuch_config_open (void *ctx,
\r
163 > notmuch_config_set_new_ignore (config, NULL, 0);
\r
166 > + if (notmuch_config_get_new_scan (config, &tmp) == NULL) {
\r
167 > + notmuch_config_set_new_scan (config, NULL, 0);
\r
170 > if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {
\r
172 > const char *tags[] = { "deleted", "spam" };
\r
173 > @@ -631,6 +642,14 @@ notmuch_config_get_new_ignore (notmuch_config_t *config, size_t *length)
\r
174 > &(config->new_ignore_length), length);
\r
178 > +notmuch_config_get_new_scan (notmuch_config_t *config, size_t *length)
\r
180 > + return _config_get_list (config, "new", "scan",
\r
181 > + &(config->new_scan),
\r
182 > + &(config->new_scan_length), length);
\r
186 > notmuch_config_set_user_other_email (notmuch_config_t *config,
\r
187 > const char *list[],
\r
188 > @@ -658,6 +677,15 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,
\r
189 > &(config->new_ignore));
\r
193 > +notmuch_config_set_new_scan (notmuch_config_t *config,
\r
194 > + const char *list[],
\r
197 > + _config_set_list (config, "new", "scan", list, length,
\r
198 > + &(config->new_scan));
\r
202 > notmuch_config_get_search_exclude_tags (notmuch_config_t *config, size_t *length)
\r
204 > diff --git a/notmuch-new.c b/notmuch-new.c
\r
205 > index 1f11b2c..57b27bf 100644
\r
206 > --- a/notmuch-new.c
\r
207 > +++ b/notmuch-new.c
\r
208 > @@ -239,6 +239,16 @@ _entry_in_ignore_list (const char *entry, add_files_state_t *state)
\r
212 > +/* Call out to the appropriate add_files function, based on the URI. */
\r
213 > +static notmuch_status_t
\r
214 > +add_files_uri (unused(notmuch_database_t *notmuch),
\r
215 > + unused(const char *uri),
\r
216 > + unused(add_files_state_t *state))
\r
218 > + /* Stub for now */
\r
219 > + return NOTMUCH_STATUS_SUCCESS;
\r
222 > /* Examine 'path' recursively as follows:
\r
224 > * o Ask the filesystem for the mtime of 'path' (fs_mtime)
\r
225 > @@ -843,6 +853,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
228 > const char *db_path;
\r
229 > + const char **new_scan;
\r
230 > + size_t new_scan_length, new_scan_i;
\r
231 > char *dot_notmuch_path;
\r
232 > struct sigaction action;
\r
233 > _filename_node_t *f;
\r
234 > @@ -941,6 +953,12 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
235 > timer_is_active = TRUE;
\r
238 > + new_scan = notmuch_config_get_new_scan (config, &new_scan_length);
\r
240 > + for (new_scan_i = 0; new_scan_i < new_scan_length; new_scan_i++) {
\r
241 > + add_files_uri (notmuch, new_scan[new_scan_i], &add_files_state);
\r
244 > ret = add_files (notmuch, db_path, &add_files_state);
\r
247 > diff --git a/test/config b/test/config
\r
248 > index 93ecb13..b0ad0c1 100755
\r
249 > --- a/test/config
\r
250 > +++ b/test/config
\r
251 > @@ -52,6 +52,7 @@ user.primary_email=test_suite@notmuchmail.org
\r
252 > user.other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org
\r
253 > new.tags=unread;inbox;
\r
256 > search.exclude_tags=
\r
257 > maildir.synchronize_flags=true
\r
258 > foo.string=this is another string value
\r
262 > _______________________________________________
\r
263 > notmuch mailing list
\r
264 > notmuch@notmuchmail.org
\r
265 > http://notmuchmail.org/mailman/listinfo/notmuch
\r