Re: [PATCH] Fix code extracting the MTA from Received: headers
authorCarl Worth <cworth@cworth.org>
Tue, 13 Apr 2010 17:37:49 +0000 (10:37 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:37 +0000 (09:36 -0800)
4c/d68d522d1ac58bc69a7abea8827586fba8a1fd [new file with mode: 0644]

diff --git a/4c/d68d522d1ac58bc69a7abea8827586fba8a1fd b/4c/d68d522d1ac58bc69a7abea8827586fba8a1fd
new file mode 100644 (file)
index 0000000..1e90fee
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <cworth@cworth.org>\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 19AAF4196F2\r
+       for <notmuch@notmuchmail.org>; Tue, 13 Apr 2010 10:37:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.89\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5\r
+       tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]\r
+       autolearn=ham\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 BaQr57ry1ej2; Tue, 13 Apr 2010 10:37:50 -0700 (PDT)\r
+Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 17615431FC1;\r
+       Tue, 13 Apr 2010 10:37:50 -0700 (PDT)\r
+Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
+       id C0E045883A6; Tue, 13 Apr 2010 10:37:49 -0700 (PDT)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: Dirk Hohndel <hohndel@infradead.org>,\r
+       Sebastian Spaeth <Sebastian@SSpaeth.de>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Fix code extracting the MTA from Received: headers\r
+In-Reply-To: <m3sk76geyj.fsf@x200.gr8dns.org>\r
+References: <m31verxaka.fsf@x200.gr8dns.org> <877hoil6i5.fsf@SSpaeth.de>\r
+       <m3sk76geyj.fsf@x200.gr8dns.org>\r
+Date: Tue, 13 Apr 2010 10:37:49 -0700\r
+Message-ID: <87eiijl0cy.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\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: Tue, 13 Apr 2010 17:37:51 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Thu, 08 Apr 2010 08:07:48 -0700, Dirk Hohndel <hohndel@infradead.org> wr=\r
+ote:\r
+> Right now my plan is to do something like this:\r
+>=20\r
+> 1) look for my email address in To/Cc\r
+> 2) look for my email in "for <email@add.res>" in Received headers\r
+> 3) look for my email in X-Original-To\r
+> 4) look for the domain of my email in Received headers (not just 1st)\r
+> 5) punt and use default email address\r
+>=20\r
+> Does that sound sane?\r
+\r
+It sounds sane.\r
+\r
+> (and thanks for sending the headers - this really helps... can others\r
+> for whom the current code or the logic mentioned above wouldn't work\r
+> send their headers, too, please?)\r
+\r
+I started using fetchmail many years ago and have never really needed to\r
+switch. So I'm still using that, (but don't necessarily recommend it to\r
+anyone.\r
+\r
+It seems to break the above since it delivers mail locally, so the first\r
+headers I get are:\r
+\r
+       X-Original-To: cworth@localhost\r
+       Delivered-To: cworth@localhost\r
+       Received: from yoom.home.cworth.org (yoom.home.cworth.org [127.0.0.1])\r
+               by yoom.home.cworth.org (Postfix) with ESMTP id D391B5883A6\r
+               for <cworth@localhost>; Mon, 12 Apr 2010 09:11:18 -0700 (PDT)\r
+       MIME-Version: 1.0\r
+       Received: from 10.22.226.213 [10.22.226.213]\r
+               by yoom.home.cworth.org with IMAP (fetchmail-6.3.16)\r
+               for <cworth@localhost> (single-drop); Mon, 12 Apr 2010 09:11:18 -0700 (PD=\r
+T)\r
+\r
+And none of these are useful for your detection. Worse, the presence of\r
+"cworth.org" in the above might throw your detection off before it could\r
+find something useful like "intel.com" in a later Received header.\r
+\r
+I'll send a complete message with full headers to you separately.\r
+\r
+Perhaps I can just switch programs to transfer email and avoid this\r
+problem. Anyone have a recommendation for something to transfer mail\r
+From=20an imap server to the local matchine, (but *not* leaving it stored\r
+on the imap server)[*]. I don't think offlineimap supports this mode\r
+does it?\r
+\r
+=2DCarl\r
+\r
+[*] I do separately want to start playing with remote notmuch, but I\r
+won't use this with the imap servers currently accepting my\r
+mail. Instead, I'd rather just rsync my mail from my local machine to a\r
+server I own, (which could then export imap if needed), and do remote\r
+notmuch stuff from there.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iD8DBQFLxKvt6JDdNq8qSWgRAhkoAJ4oh+edQbAph1qb3uoi8K43hmZlJQCgm796\r
+FnNzMoXac4WqsIyMOH011D0=\r
+=K2Mi\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r