procmail
[Top] [All Lists]

Re: match a set of header-lines

2002-03-22 15:40:38
On 22 Mar, Ruud H.G. van Tol wrote:
| David chiselled:
| 
| > 
| > [after some elisions]
| 
| <hehe> I still have not checked whether an IP-number 
| like [061.000.000.001] is allowed/possible in a 
| Received:-header. 
| 

I don't *know*, i.e. can't reference any rfc's, but I don't think so.
At least I didn't see any leading zeros in any octet in a quick run
through about 5300 archived messages. There's no guarantee that I
didn't miss some though. This is how I did it so someone can jump in if
something is flawed.

(from parent directory of archived message hierarchy)

for f in `find -type f`; do formail -s formail -cXReceived: <$f \
  |egrep '\<0[0-9][0-9]?\.[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]\>'; done

What it did turn up was some 37 matches on mta version numbers like
Sun Internet Mail Server and InterMail. I don't know if that matters to
Ruud, or even if his regexp would match any of those since I don't know
the context he's using (like enclosing \[ ] or anchors), but there it
is.

FWIW (very little) this is what I use in a similar context:

OCTET123='(0|[1-9][0-9]?|1[0-9][0-9]|2([0-4][0-9]|5[0-5]))'
OCTET4='(0|[1-9][0-9]?|1[0-9][0-9]|2([0-4][0-9]|5[0-4]))'

I have no idea how effective it is, not because that's the standard
disclaimer but because I really have NO idea. It's not used with
procmail, but in an unrelated script to build a regexp on the fly for
matching something like "Received:.*\[61.32.$OCTET123.$OCTET4]" given
"61.32".  Anyway, I've never had a problem, but I don't use it much.
I'm sure I spent some time testing it, but I can't say how much because
I have no idea. Lastly, I can't say if I started from someone else's
work, borrowed it in it's entirety, or dreamt this up myself, because...
I have no idea.

-- 
Reply to list please, or append "6" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


_______________________________________________
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>