notmuch reply From:-guessing heuristics
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Thu, 8 Dec 2011 21:53:04 +0000 (10:53 +1300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:41 +0000 (09:40 -0800)
6a/93577c5bb0ade7b823d29bbe61c8cfdb951913 [new file with mode: 0644]

diff --git a/6a/93577c5bb0ade7b823d29bbe61c8cfdb951913 b/6a/93577c5bb0ade7b823d29bbe61c8cfdb951913
new file mode 100644 (file)
index 0000000..bf58084
--- /dev/null
@@ -0,0 +1,97 @@
+Return-Path: <michael.hudson@canonical.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4B304429E25\r
+       for <notmuch@notmuchmail.org>; Thu,  8 Dec 2011 13:53:11 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id b75SsWvGul7G for <notmuch@notmuchmail.org>;\r
+       Thu,  8 Dec 2011 13:53:10 -0800 (PST)\r
+Received: from youngberry.canonical.com (youngberry.canonical.com\r
+       [91.189.89.112])\r
+       by olra.theworths.org (Postfix) with ESMTP id AE2CF431FD0\r
+       for <notmuch@notmuchmail.org>; Thu,  8 Dec 2011 13:53:10 -0800 (PST)\r
+Received: from [120.136.5.22] (helo=narsil)\r
+       by youngberry.canonical.com with esmtpsa\r
+       (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71)\r
+       (envelope-from <michael.hudson@canonical.com>) id 1RYltt-00039G-Al\r
+       for notmuch@notmuchmail.org; Thu, 08 Dec 2011 21:53:09 +0000\r
+Received: by narsil (Postfix, from userid 1000)\r
+       id DE40852054C; Fri,  9 Dec 2011 10:53:04 +1300 (NZDT)\r
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: notmuch reply From:-guessing heuristics\r
+User-Agent: Notmuch/0.10.1 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 09 Dec 2011 10:53:04 +1300\r
+Message-ID: <8762hq7mtb.fsf@canonical.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 08 Dec 2011 21:53:11 -0000\r
+\r
+Hi all,\r
+\r
+I have a specific example where "notmuch reply" does not set a useful\r
+from: header.  The set is:\r
+\r
+1) I have a google apps-for-your-domain address,\r
+   michael.hudson@linaro.org\r
+\r
+2) There is a group/alias, validation@linaro.org that only accepts mail\r
+   from members\r
+\r
+3) michael.hudson@linaro.org forwards to michael.hudson@canonical.com,\r
+   from where I get email with offlineimap.\r
+\r
+4) michael.hudson@linaro.org and michael.hudson@canonical.com are both\r
+   configured as addresses in ~/.notmuch-config with the linaro.org\r
+   address being primary.\r
+\r
+When I reply to a mail to validation@linaro.org, the guessed address is\r
+michael.hudson@canonical.com and unless I change it, the reply bounces,\r
+which is obviously a bit annoying.\r
+\r
+Looking at the headers (and the notmuch source),\r
+michael.hudson@canonical.com seems to be being found in the Received\r
+headers.  michael.hudson@linaro.org is not in any Received header, which\r
+is a bit strange, but in any case I think the code would find\r
+michael.hudson@canonical.com first (would it perhaps make more sense to\r
+search backwards through received?  An earlier header is probably closer\r
+to what was intended, in some sense).\r
+\r
+michael.hudson@linaro.org does appear in a Delivered-To: header, so\r
+maybe those could be considered (it seems that some MTAs add a\r
+Delivered-To header from the envelope address, so it would have some\r
+legitimacy)?  It would work in this case, but only because the\r
+Delivered-To that the canonical.com MTA adds is an internal address\r
+that's not configured as an address for me in notmuch...\r
+\r
+Alternatively, *I* wouldn't mind if notmuch stopped trying at all hard,\r
+and just used the primary address if there was nothing matching in\r
+to:/cc: but I guess that wouldn't work on mailing lists at all...\r
+\r
+Hm, I guess I've argued myself around to thinking that considering\r
+Delivered-To as a source of potential from addresses would be an\r
+improvement.  What do you guys think?\r
+\r
+Cheers,\r
+mwh\r