Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / ca / 9cd4e1012f5136d672471a5e7013c6631305b6
1 Return-Path: <BATV+7d079ec6ed591f168fc6+2419+infradead.org+hohndel@bombadil.srs.infradead.org>\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 F227F4196F0\r
6         for <notmuch@notmuchmail.org>; Thu,  8 Apr 2010 08:07:50 -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: -2.301\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.301 tagged_above=-999 required=5\r
12         tests=[BAYES_20=-0.001, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham\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 4FsacYNCgFjA for <notmuch@notmuchmail.org>;\r
16         Thu,  8 Apr 2010 08:07:50 -0700 (PDT)\r
17 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 0B7C8431FC1\r
19         for <notmuch@notmuchmail.org>; Thu,  8 Apr 2010 08:07:50 -0700 (PDT)\r
20 Received: from localhost ([::1] helo=localhost.localdomain)\r
21         by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
22         id 1NztKf-0000Ft-3h; Thu, 08 Apr 2010 15:07:49 +0000\r
23 Received: by localhost.localdomain (Postfix, from userid 500)\r
24         id B15F0C00E4; Thu,  8 Apr 2010 08:07:48 -0700 (PDT)\r
25 From: Dirk Hohndel <hohndel@infradead.org>\r
26 To: Sebastian Spaeth <Sebastian@SSpaeth.de>, notmuch@notmuchmail.org\r
27 Subject: Re: [PATCH] Fix code extracting the MTA from Received: headers\r
28 In-Reply-To: <877hoil6i5.fsf@SSpaeth.de>\r
29 References: <m31verxaka.fsf@x200.gr8dns.org> <877hoil6i5.fsf@SSpaeth.de>\r
30 Date: Thu, 08 Apr 2010 08:07:48 -0700\r
31 Message-ID: <m3sk76geyj.fsf@x200.gr8dns.org>\r
32 MIME-Version: 1.0\r
33 Content-Type: text/plain; charset=us-ascii\r
34 X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
35         bombadil.infradead.org See http://www.infradead.org/rpr.html\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Thu, 08 Apr 2010 15:07:51 -0000\r
49 \r
50 On Thu, 08 Apr 2010 09:59:14 +0200, "Sebastian Spaeth" <Sebastian@SSpaeth.de> wrote:\r
51 > On 2010-04-07, Dirk Hohndel wrote:\r
52 > > \r
53 > > The previous code made too many assumptions about the (sadly not\r
54 > > standardized) format of the Received headers. This version should\r
55 > > be more robust to deal with different variations.\r
56\r
57 > This code might be useful for some, but I know it is not being useful\r
58 > for me. I use e.g. dreamhost.com as my mail provider and I never have my\r
59 > email domain name show up after the Received: by .....\r
60 > See my Received headers for your message below.\r
61 \r
62 That's the funny thing about heuristics - they are always based on the\r
63 cases the author has access to. I run my own mail servers and they put\r
64 in useful Received lines. Dreamhost doesn't appear to do that - I'm sure\r
65 there are many other scenarios that I don't handle, yet.\r
66 Please keep them coming.\r
67  \r
68 > On the other hand, it contains "for <sebastian@sspaeth.de>" stating the\r
69 > intended email address explicitely. IMHO, we should use this before we\r
70 > start some hand-wavy guessing.\r
71\r
72 > Also, I have the "X-Original-To: sebastian@sspaeth.de" header. Is that\r
73 > something that we could make use of before starting to guess?\r
74 \r
75 It's complicated. Some MTAs put in bogux "for <user@localhost>" or "for\r
76 UID 1000" into Received headers. I haven't seen any incorrect\r
77 "X-Original-To" headers, but wouldn't be surprised to see those be faked\r
78 or wrong, either.\r
79 Right now my plan is to do something like this:\r
80 \r
81 1) look for my email address in To/Cc\r
82 2) look for my email in "for <email@add.res>" in Received headers\r
83 3) look for my email in X-Original-To\r
84 4) look for the domain of my email in Received headers (not just 1st)\r
85 5) punt and use default email address\r
86 \r
87 Does that sound sane?\r
88 \r
89 (and thanks for sending the headers - this really helps... can others\r
90 for whom the current code or the logic mentioned above wouldn't work\r
91 send their headers, too, please?)\r
92 \r
93 /D\r
94 \r
95 -- \r
96 Dirk Hohndel\r
97 Intel Open Source Technology Center\r