At 09:30 2006-08-15 +0200, Udi Mottelo wrote:
On Tue, 15 Aug 2006, Brandon Enright wrote:
On Mon, 2006-08-14 at 19:42 -0500, Jack Stone wrote:
I am trying to use a procmail recipe that first runs a perl script to get
the "remote IP" of a message, but I have a syntax error in the perl
Got the script from SORBS.
I'm not a perl expert but I think that if you get a message with
Subject: Matlab ver. [9.44.300.6] The following scripts will give
You should ask your self and fine the answer in the place where
you took the script, what is "remote IP".
Well, let's face it, the thing looks for IP-octet-like constructs, not even
limited to the octet ranges, or limited to Received: type headers.
I pointed out that it can be easily accomplished within procmail. I
probably should have specifically pointed the OP to my sandbox page, where
the following code can be found as part of the standard setup. This is
also part of my standard .procmailrc, executed on each and every message
that reaches my inbox:
# Obtain the hostname of the host which relayed the message to us.
# This is found in the topmost received header.
# can do this, at expense of additional process:
# RELAYHOSTX=`formail -u Received: -czx Received:`
* ^Received:\/ from.*
# The hostname provided in the SMTP EHLO exchange will be the first
# token on this line.
* RELAYHOSTX ?? ^from \/[^ ]*
# Then isolate the hostname portion (if any) in the parenthetical.
* RELAYHOSTX ?? ^from [^ ]* \(\/[^)]*\)\>+by\>
* MATCH ?? ^\/[^)]+
* RELAYHOSTX ?? ^\/[^[ ]+
# grab whatever up to the first space or the open
# brackets for the IP.
* RELAYHOSTX ?? ()\[\/[^] ]+
# grab the apparent host IP from the brackets
# Since this should have been generated and
# inserted by the local mailhost, it should follow
# standard format, and not be "hokified" by a spammer.
# null out RELAYHOSTX (temp variable used in the extraction process)
# if the relay host has no rDNS, RELAYHOST should be undefined.
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 homepage: http://www.procmail.org/