procmail
[Top] [All Lists]

Re: question regarding header handoff to external script

1999-12-25 15:32:52


On Sat, 25 Dec 1999, Stan Ryckman wrote:

Well, I don't know perl well enough, but I fed your post to it
and it prints (with no trailing newline) the string:
199.0.65.219137.226144.13137.226.116.240
which doesn't look terribly useful.  I think it's concatenating
an IP from every Received: header.

If you fix that up (and I don't know how you're intending to
pick the "correct" Received: to look at) then...

Thanks for that. That was a little bug that I've fixed. My intention is to
look at every extracted IP (the really interesting one is usually the
last) as an open relay as an intermediate step should be suspect.

 
      # I think you'll want 'c' here but it depends on what you
      # want to do with the rest of the processing:
      :0c
      * any other conditions
      {
        IPVALUE=`mailExtractIP`
        ... stuff using $IPVALUE ...
      }

3 questions. 

1) How do I get the exit code back from an external program? 
2) The way you have the recipe worded, how does mailExtractIP get passed
   via STDIN the headers to be parsed?
3) is it possible/legal to do 

   | formail -A"X-SPAM: Originating or relay host is in RBL" | dmail
+incoming/spam

that is to tack on a message header before sending it off to the spam
folder?

--Jauder

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