procmail
[Top] [All Lists]

Re: FINDING RELAY IP

2002-07-06 19:38:50

    Thanks Sean.  The man page says that procmail is passed any
values in the -a $x -a $y line of the call to it in sendmail.cf

    I should be able to pass -a $&{client_addr}, but it doesn't
seem to be working :(

    Homer

------------------------------------------------------------------------
Homer Wilson Smith     I would rather die poor    Lightlink Internet
(607) 277-0959 KC2ITF  than suffer the patronage  Ithaca, NY
homer(_at_)lightlink(_dot_)com    of bigots and pinheads.    www.lightlink.com

On Sat, 6 Jul 2002, Professional Software Engineering wrote:

At 15:23 2002-07-06 -0400, Homer Wilson Smith wrote:
   In the following procmailrc is there an easy way for the
perl script called 'spam' to know the IP number of the
mail server sending the e-mail message (relay IP) without
having to scan headers for it?

Oh, oh, I know the answer!

No.

Procmail isn't handed information on the server which passed the message to
the MTA (if in fact the message was even passed by a remote server and not
locally delivered, or procmail was invoked in generic mail filter
mode).  The only information you'll have about the connecting server will
be in the headers, which you'll have to "scan" (whether your perl script
does that, or a procmail MATCH extraction is used, is a different matter -
somebody is scanning the headers).

This might work to extract the IP address, but it is untested, and relies
on your MTA inserting it into the received in a certain fashion:

:0
* ^Received:.*\[\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
{
         HOSTIP=$MATCH
}

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>