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.
Except that you'll only be interested in the one that your machine adds --
which will be the very first one in the message. And there's no worry about
variable formats; it will be added by your qmail setup, and qmail has a very
rigid structure for the Received: fields it adds. They're always the same,
and trivial to parse.
> 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)
Nope. I've parsed the IP of the previous hop out of messages with a single
regex; qmail's headers really are that structured.
> > >Not much of a source hacker I did go into received.c and tried adding
> >
> > Stop right there. Do NOT hack qmail's source unless you *really* know
> > what you're doing.
>
> Hey, it's not like I was going to ship it anywhere. (All the other kids
> are doing it...)
The problem is that an MTA is a security-critical piece of software. djb put
an awful lot of effort into making sure that qmail is secure, reliable, and
efficient (pick any three) -- the tiniest slipup on your part while patching
qmail could make your box vulnerable to remote root exploits, or unauthorized
relaying, or crash your box, ...
Charles
--
-----------------------------------------------------------------------
Charles Cazabon <[EMAIL PROTECTED]>
GPL'ed software available at: http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
-----------------------------------------------------------------------