Mark Jeftovic <[EMAIL PROTECTED]> wrote:
>On Fri, 25 May 2001, Dave Sill wrote:
>>
>> You can parse that from the Received fields.
>
>That's my plan of last resort. I didn't want to do this unless I really
>had to because of the different formats the Received headers can have,
>and that there can be any number of them.
It's not that bad because they're in reverse cronological order, and
the one you want to look at is always in qmail-smtpd's format, and
it's the second Received field.
>My life would be made a lot easier if I had ready access to the
>hostname/IP that is giving me the email without doing the guesswork
>(which is what parsing the Received headers will amount to in the end)
No, Received fields aren't randon junk. You can trust the ones added
by qmail.
>So I guess there is no readily available way to do this?
Nothing easier that parsing the Received fields. E.g., it took me
about a minute to come up with:
822field received <msg|sed '1d'|sed '2,$d'|sed 's/.*(//'
Which uses 822field from DJB's mess822 to extract the IP address of
the sending host from a message.
>P.S. I take it you are using tmda for your reply-to? I stumbled on this
>in the course of researching and it looks like just what the doctor
>ordered for my purposes.
It's great. I've received almost no spam since implementing it. The
only spam that's gotten through has gone through our "helpful" relay
which "fixes" unqualified addresses by tacking on "ornl.gov", which is
on my whitelist, of course.
-Dave