unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dirk Hohndel <hohndel@infradead.org>
To: Sebastian Spaeth <Sebastian@SSpaeth.de>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Fix code extracting the MTA from Received: headers
Date: Thu, 08 Apr 2010 08:07:48 -0700	[thread overview]
Message-ID: <m3sk76geyj.fsf@x200.gr8dns.org> (raw)
In-Reply-To: <877hoil6i5.fsf@SSpaeth.de>

On Thu, 08 Apr 2010 09:59:14 +0200, "Sebastian Spaeth" <Sebastian@SSpaeth.de> wrote:
> On 2010-04-07, Dirk Hohndel wrote:
> > 
> > The previous code made too many assumptions about the (sadly not
> > standardized) format of the Received headers. This version should
> > be more robust to deal with different variations.
> 
> This code might be useful for some, but I know it is not being useful
> for me. I use e.g. dreamhost.com as my mail provider and I never have my
> email domain name show up after the Received: by .....
> See my Received headers for your message below.

That's the funny thing about heuristics - they are always based on the
cases the author has access to. I run my own mail servers and they put
in useful Received lines. Dreamhost doesn't appear to do that - I'm sure
there are many other scenarios that I don't handle, yet.
Please keep them coming.
 
> On the other hand, it contains "for <sebastian@sspaeth.de>" stating the
> intended email address explicitely. IMHO, we should use this before we
> start some hand-wavy guessing.
> 
> Also, I have the "X-Original-To: sebastian@sspaeth.de" header. Is that
> something that we could make use of before starting to guess?

It's complicated. Some MTAs put in bogux "for <user@localhost>" or "for
UID 1000" into Received headers. I haven't seen any incorrect
"X-Original-To" headers, but wouldn't be surprised to see those be faked
or wrong, either.
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@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?

(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?)

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center

  reply	other threads:[~2010-04-08 15:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 20:38 [PATCH] Fix code extracting the MTA from Received: headers Dirk Hohndel
2010-04-07 22:56 ` Carl Worth
2010-04-08  7:59 ` Sebastian Spaeth
2010-04-08 15:07   ` Dirk Hohndel [this message]
2010-04-13 17:37     ` Carl Worth
2010-04-13 18:06       ` Dirk Hohndel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sk76geyj.fsf@x200.gr8dns.org \
    --to=hohndel@infradead.org \
    --cc=Sebastian@SSpaeth.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).