Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / ec / af8f2a0bb6ae04dd5f08759a22d70d20f0d3ca
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 1C71A431FAF\r
6         for <notmuch@notmuchmail.org>; Mon,  2 Jun 2014 07:26:54 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.502\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.502 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_LOW=-0.7] 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 tjaDXFUH5Vyf for <notmuch@notmuchmail.org>;\r
17         Mon,  2 Jun 2014 07:26:46 -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 451BE431FAE\r
22         for <notmuch@notmuchmail.org>; Mon,  2 Jun 2014 07:26:46 -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 1WrTCA-0005pG-Ev; Mon, 02 Jun 2014 15:26:42 +0100\r
27 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1WrTBp-0004vv-RA; Mon, 02 Jun 2014 15:26:18 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>,\r
33         Vladimir Marek <Vladimir.Marek@oracle.com>, notmuch@notmuchmail.org\r
34 Subject: Re: Deduplication ?\r
35 In-Reply-To: <m2ppirs8ea.fsf@guru.guru-group.fi>\r
36 References: <20140602123212.GA12639@virt.cz.oracle.com>\r
37         <87d2ers9mi.fsf@qmul.ac.uk> <m2ppirs8ea.fsf@guru.guru-group.fi>\r
38 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
39         (i486-pc-linux-gnu)\r
40 Date: Mon, 02 Jun 2014 15:26:17 +0100\r
41 Message-ID: <87ppirqtfa.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 87.81.223.162\r
45 X-QM-Geographic: According to ripencc,\r
46         this message was delivered by a machine in Britain (UK) (GB).\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: a4ad9178de7ec0417b84cd85a95f33c0 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -0.1\r
50 X-SpamAssassin-SpamBar: /\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -0.1 points.\r
55         Summary of the scoring: \r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         * -0.1 AWL AWL: From: address is in the auto white-list\r
59 X-QM-Scan-Virus: ClamAV says the message is clean\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Mon, 02 Jun 2014 14:26:54 -0000\r
73 \r
74 \r
75 Tomi Ollila <tomi.ollila@iki.fi> writes:\r
76 \r
77 > On Mon, Jun 02 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
78 >\r
79 >> Vladimir Marek <Vladimir.Marek@oracle.com> writes:\r
80 >>\r
81 >>> Hi,\r
82 >>>\r
83 >>> I want to import bigger chunk of archived messages into my notmuch\r
84 >>> database. It's about 100k messages. The problem is, that I most probably\r
85 >>> have quite a lot of those messages in the DB. Basically I would like to\r
86 >>> add only those I don't have already.\r
87 >>>\r
88 >>> There are two possibilities\r
89 >>>\r
90 >>> a) I will add all the 100k messages and then remove the duplicities.\r
91 >>>\r
92 >>> b) I will write a script which will parse the message ID's of the\r
93 >>>    to-be-added messages and try to match them to the notmuch DB. Adding\r
94 >>>    only files I can't find already.\r
95 >>>\r
96 >>> Ad b) might be better option, but I started to play with the idea of\r
97 >>> deduplication. I'm thinking about listing all the message IDs stored in\r
98 >>> DB, listing all files belonging to the IDs and deleting all but one.\r
99 >>> Also I'm thinking about implementing some simple algorithm telling me\r
100 >>> whether the messages are really very similar. Just to be sure I don't\r
101 >>> delete something I don't want to.\r
102 >>>\r
103 >>> Was anyone playing with the idea?\r
104 >>\r
105 >> I am not sure what your use case is but notmuch automatically\r
106 >> deduplicates: that is if the message-id is one it has already seen no\r
107 >> further indexing takes place. The only thing that happens is the new\r
108 >> filename gets added to the list of filenames for the message.\r
109 >>\r
110 >> Thus importing should be almost as fast as if the message were not\r
111 >> there, and the database should be almost identical to what you would get\r
112 >> if you only imported the genuine new messages.\r
113 >>\r
114 >> If you want to save disk space then you could delete the duplicates\r
115 >> after with something like\r
116 >>\r
117 >> notmuch search --output=files --format=text0 --duplicate=2 '*' piped to\r
118 >> xargs -0\r
119 >\r
120 > What if there are 3 duplicates (or 4... ;)\r
121 \r
122 I was assuming that it was merging 2 duplicate-free bunches of messages,\r
123 but I guess the new 100000 might not be. In that case running the above\r
124 repeatedly (ie until it is a no-op) would be fine. \r
125 \r
126 >\r
127 >>\r
128 >> (but please test it carefully first!)\r
129 >\r
130 > One should also have some message content heuristics to determine that the\r
131 > content is indeed duplicate and not something totally different (not that\r
132 > we can see the different content anyway... but...)\r
133 \r
134 That would be nice.\r
135 \r
136 Best wishes\r
137 \r
138 Mark\r
139 \r
140 \r
141 >>\r
142 >> I would think something like this is better than trying to parse the\r
143 >> message-ids yourself.\r
144 >\r
145 >\r
146 >>\r
147 >> Best wishes\r
148 >>\r
149 >> Mark\r
150 >>\r
151 >\r
152 > Tomi\r
153 >\r
154 >\r
155 >>\r
156 >>>\r
157 >>> -- \r
158 >>>     Vlad\r