procmail
[Top] [All Lists]

Host lookups

2008-11-28 02:18:23
I have a little php script that sends me the following when someone "hits" a particular page:

Wed Nov 26 20:39:43 EST 2008
Remote = 75.104.35.214
Remote Name =
Referer = http://www.mydomain.com/journal/
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MindSpring Internet Serv$

I've recently switched servers. The old server did host lookups. The new one doesn't. I'm trying to use procmail to do the host lookup so I can see the "Remote Name." So far I have:

:0
* ^Return-Path: <fleet(_at_)core(_dot_)mynewhost(_dot_)com>
* ^Subject: Journal hit
   {
     :0 cB
     * Remote = \/.*
     | XXX=`host $MATCH | cut -d' ' -f5`

     LOG="$XXX
     "

     :0
     results
   }

Everything works until I get to the | XXX line. Nothing gets assigned to XXX. MATCH shows in the log as - procmail: Matched "75.104.35.214" for example.

Log shows:

procmail: Executing " XXX=`host $MATCH | cut -d' ' -f5`"
procmail: Assigning "LASTFOLDER= XXX=`host $MATCH | cut -d' ' -f5`"
From fleet(_at_)core(_dot_)openthoughthosting(_dot_)com  Wed Nov 26 21:13:24 
2008
 Subject: Journal hit
Folder: XXX=`host $MATCH | cut -d' ' -f5` 1035
procmail: Assigning "LOG=
     "

procmail: Assigning "LASTFOLDER=results"

So how do I get the output of the host lookup into that XXX variable, please?

                                - fleet -

PS: I know host lookups require time; but I only get about a dozen of these Journal Hits a day.
____________________________________________________________
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>