[PATCH] Fix code extracting the MTA from Received: headers

Carl Worth cworth at cworth.org
Tue Apr 13 10:37:49 PDT 2010


On Thu, 08 Apr 2010 08:07:48 -0700, Dirk Hohndel <hohndel at infradead.org> wrote:
> Right now my plan is to do something like this:
> 
> 1) look for my email address in To/Cc
> 2) look for my email in "for <email at add.res>" in Received headers
> 3) look for my email in X-Original-To
> 4) look for the domain of my email in Received headers (not just 1st)
> 5) punt and use default email address
> 
> Does that sound sane?

It sounds sane.

> (and thanks for sending the headers - this really helps... can others
> for whom the current code or the logic mentioned above wouldn't work
> send their headers, too, please?)

I started using fetchmail many years ago and have never really needed to
switch. So I'm still using that, (but don't necessarily recommend it to
anyone.

It seems to break the above since it delivers mail locally, so the first
headers I get are:

	X-Original-To: cworth at localhost
	Delivered-To: cworth at localhost
	Received: from yoom.home.cworth.org (yoom.home.cworth.org [127.0.0.1])
		by yoom.home.cworth.org (Postfix) with ESMTP id D391B5883A6
		for <cworth at localhost>; Mon, 12 Apr 2010 09:11:18 -0700 (PDT)
	MIME-Version: 1.0
	Received: from 10.22.226.213 [10.22.226.213]
		by yoom.home.cworth.org with IMAP (fetchmail-6.3.16)
		for <cworth at localhost> (single-drop); Mon, 12 Apr 2010 09:11:18 -0700 (PDT)

And none of these are useful for your detection. Worse, the presence of
"cworth.org" in the above might throw your detection off before it could
find something useful like "intel.com" in a later Received header.

I'll send a complete message with full headers to you separately.

Perhaps I can just switch programs to transfer email and avoid this
problem. Anyone have a recommendation for something to transfer mail
From an imap server to the local matchine, (but *not* leaving it stored
on the imap server)[*]. I don't think offlineimap supports this mode
does it?

-Carl

[*] I do separately want to start playing with remote notmuch, but I
won't use this with the imap servers currently accepting my
mail. Instead, I'd rather just rsync my mail from my local machine to a
server I own, (which could then export imap if needed), and do remote
notmuch stuff from there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100413/26c80858/attachment.pgp>


More information about the notmuch mailing list