MailScanner & IPv6 [SOLVED]
Rick Cooper
rcooper at DWFORD.COM
Wed Apr 6 13:36:48 IST 2005
[ The following text is in the "ISO-8859-15" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]
> -----Original Message-----
> From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> Behalf Of Mike
> Sent: Wednesday, April 06, 2005 6:56 AM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: MailScanner & IPv6 [SOLVED]
>
>
> >-----Original Message-----
> >From: MailScanner mailing list [mailto:MAILSCANNER at JISCMAIL.AC.UK] On
> >Behalf Of Rick Cooper
> >
> >Yeah, should have made that "(?:Ipv6:)?" oops! I doubt that the
> accuracy of
> >the address is an issue once it's gotten to mailscanner anyway.
>
> How about this then:
>
> if ($ip =~ /\[[IPv6:]*([\d.:abcdef]+)\]/) {
>
> This way, the IP address can optionally consist of the "IPv6:"
> tag. I'm not sure if the IPv6: tag is Linux specific. If it DOES
> consists of the IPv6: tag, the tag will not be removed.
I am thinking, and again I am not a sendmail man, that the IPv6: is a
sendmail designation for logging or other internal use. If you do a:
host IPv6:2001:888:0:1::666 you get Host IPv6:2001:888:0:1::666 not found:
3(NXDOMAIN)
but if you do:
host 2001:888:0:1::666 you get
6.6.6.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.0.0.0.8.8.8.0.1.0.0.2.ip6.arpa
domain name pointer xs6.xs4all.nl.
So as you can see the IPv6 is not actually part of the IP address and the
code fragment is attempting to retrieve the IP address (hence the
$message->{clientip} = $1; part). That is why I used (?:IPv6:)? which is
non-capturing and leaves the $1 set as the actual IP portion of
[IPv6:address] or [dotted quad address]. I haven't looked through all the
code so I don't know if this address is used for anything other than
logging. If it is, then it would be important that only an accurate address
be returned. Anyway as you can verify by doing a lookup on the address in
your example adding in the IPv6: portion results in an address that cannot
be resolved, removing it results in a resolvable address.
Rick
>
> Mike.
>
> ------------------------ MailScanner list ------------------------
> To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> 'leave mailscanner' in the body of the email.
> Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
> the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
>
> Support MailScanner development - buy the book off the website!
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
Support MailScanner development - buy the book off the website!
More information about the MailScanner
mailing list