procmail
[Top] [All Lists]

Re: Procmail LDA "Received: from" headers

2000-01-22 20:31:55
Walter Dnes <waltdnes(_at_)waltdnes(_dot_)org> writes:
 My new ISP uses procmail as LDA.  I'm trying to get my procmail
filter to handle that properly, without breaking its parsing of
sendmail and Exim headers (Now *THAT* is "fun").  My "sample set"
is rather small, and applies only to my ISP.  Here is a sample...

Received: from cac3.hub.mail.psi.ca(154.11.168.213)
 via SMTP by xxxxxxxx.xxx, id smtpd07151a; Wed Jan 19 23:48:19 2000

 Does procmail (in LDA mode) always generate such a header?  It looks
like the rule is...
^Received: from (${rDNS}|UNKNOWN)\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\)
 where ${rDNS} is the reverse-DNS.

Procmail does not generate Received: headers.  These are generated by
the MTA.


 And out of general curiousity.  When is IPv6 coming out and are
there any sample emails for people to play with.  I suspect that
it'll probably break lots of stuff.

I don't know about other MTAs, but sendmail will hand of the formatting
of IPv6 addresses to the resolver library's inet_ntop() routine which
will format it as something matching the regexp:

         ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]:)*\
         ((:[0-9a-f][0-9a-f][0-9a-f][0-9a-f])+|\
          ([0-9a-f][0-9a-f][0-9a-f][0-9a-f])\
         )?\
        |\
         ::(ffff:)?%%%\.%%%\.%%%\.%%%

Where %%% represents a number between 0 and 255, i.e.,
        (0|1[0-9][0-9]?|2([01234][0-9]?|5[0-5]?|[6-9])|[3-9][0-9]?)
and the address can contain at most 8 sets of four hexidecimal digits
without a double colon, or at most seven with a double colon.


For those who wonder, an IPv6 address is 128 bits long, represented as 8
sets of 16 bits, each set printed as 4 hexadecimal numbers.  Since many
addresses are expected to contain a long run of zeros in the middle,
at most one contiguous sequence of all zero sets may be replaced with
a doubled colon.  For example, the following two addresses are equivalent:

        0020:fab0:0000:0000:0000:0000:0001:1234
        0020:fab0::0001:1234

Note that only completely zero sets may be abbreviated and that leading or
trailing zero sets may be legally abbreviated this way, ala
        
        ::0123:ebb2:298d
and
        0020:fab1:56f9::


HOWEVER, two additional forms exist to repesent "IPv4 compatible" and
"IPv4 mapped" address formats (these have different purposes in the IPv6
transition scheme but that's all outside the scope of this message):

        ::138.236.128.18
and
        ::ffff:138.236.128.18

In these two forms, the four IP style decimal octets represent the last
two sets in an IPv6 native style address.  The above two would thus be
exactly equivalent to the respective addresses:

        ::8aec:8a12
and
        ::ffff:8aec:8a12

or

        0000:0000:0000:0000:0000:0000:8aec:8a12
and
        0000:0000:0000:0000:0000:ffff:8aec:8a12


Philip Guenther

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