procmail
[Top] [All Lists]

Re: Procmail vs perl script syntax

2006-08-15 04:12:32
Jack Stone schreef:

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 script. Got the script from SORBS.

This is not a Perl list, and the script is a mess anyway, so best
replace it by a pure procmail recipe, which can be as simple as:

   REMOTEIP = '127.0.0.1'
   :0
   * ^Received: from [^[]+\[\/[0-9.]+]\).*by mxhost[0-9]+\.myisp\.tld[ ]
   * MATCH ?? ^^\/[0-9.]+
   { REMOTEIP = $MATCH }

(you need to adjust the "mxhost451.myisp.tld" part)


chop $line;

Someone must've meant chomp.


if( $line =~ /.*\[(\d+.*)\]/ )

That one is easy to go wrong too.


-- 
Groet, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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