On 22 Mar, Ruud H.G. van Tol wrote:
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.
[...]
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. [...] 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 am using this:
QUAD1="0*([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
QUADn="0*([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
IP=$QUAD1[.]$QUADn[.]$QUADn[.]$QUADn
So I assume QUAD1 can't be 0, and I allow the last QUAD to be 255,
and I allow leading 0's, and I only allow numerical value 0-255.
Further I check for [^0-9.] just before $IP.
I did find private addresses like 10.0.0.0/24 and 172.16.0.0/20
and 192.168.0.0/16 and even 196.254.0.0/16 (Microsoft-AutoAddress)
and 127.0.0.1. I ignore those, just like I ignore the addresses
of near hosts like my own and those of my ISP. See my XIP.rc at
the end of http://www.xs4all.nl/~rvtol/procmailrc.txt
Ruud
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail