You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2006/06/22 17:53:17 UTC
[Bug 4964] New: Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
Summary: Mail::SpamAssassin::NetSet: removing custom code, using
CPAN module
Product: Spamassassin
Version: SVN Trunk (Latest Devel Version)
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P5
Component: Libraries
AssignedTo: dev@spamassassin.apache.org
ReportedBy: radek@pld-linux.org
Mail::SpamAssassin::NetSet uses some custom code to keep the list of
addresses / networks. It doesn't support IPv6.
IPv6 support can of course be added using custom code, but there are
CPAN modules providing this functionality:
- http://search.cpan.org/dist/Net-IP/
- http://search.cpan.org/dist/NetAddr-IP/
- http://search.cpan.org/dist/NetAddr-IP-Lite/
I suggest using NetAddr::IP::Lite; it seemed to be least buggy and
most actively developed of all three.
This means adding another dependency, so I guess some of you will
strongly object. But:
* there should be IPv6 support
* no point in reinventing the wheel
* implementing IP RFC's isn't SA's purpose
* show must go on.
I can provide custom code to add this functionality (pack & unpack here
and there isn't that hard after all). But -- even though I trust it's
quality -- it won't be as throughly tested as a specialised module.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
jm@jmason.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Mail::SpamAssassin::NetSet: |Mail::SpamAssassin::NetSet:
|removing custom code, using |remove custom code, use CPAN
|CPAN module |module, support IPv6
Target Milestone|Undefined |3.3.0
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
jm@jmason.org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |4965
nThis| |
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2007-01-11 09:01 -------
no response from Mark; let's stick with CPAN, then.
fwiw, Net::CIDR::Lite is a dependency of Mail::SPF::Query, which would save some
RAM (since it's already loaded in that case). claims to support both ipv4 and
ipv6 addresses.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2006-11-17 10:12 -------
Mark -- that code, does it support checking if a n.n.n.n/m CIDR-specified
network range is contained by another CIDR-specified range?
if so, I think I'd like to get it into NetSet.pm. to be honest, I share your
thoughts about NetAddr::IP and the like, they all look very heavyweight --
certainly a lot more heavy than 160 lines of perl.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From Mark.Martinec@ijs.si 2007-01-24 09:43 -------
> no response from Mark; let's stick with CPAN, then.
Sorry folks, I wasn't receiving mail from this bug report
because I'm not the original poster, so I didn't notice a question.
> Mark -- that code, does it support checking if a n.n.n.n/m CIDR-specified
> network range is contained by another CIDR-specified range?
No, it only checks a single address against a list of CIDR networks
or plain addresses, the list is traversed linearly, first match wins
and may provide a true or false result (allowing for hierarchical
exceptions to be specified). The list is pre-parsed for speed.
> if so, I think I'd like to get it into NetSet.pm. to be honest,
> I share your thoughts about NetAddr::IP and the like, they all
> look very heavyweight -- certainly a lot more heavy than 160
> lines of perl.
I'll leave the decision on choice between Net::CIDR::Lite and my
code to you, as I'm not particularly familiar with Net::CIDR::Lite.
My routine is heavily relied-on in amavisd-new, and the project
is very much alive and kicking, so there is no fear it will be
abandoned any time soon. There are hardly change in code since
the version I provided a link to. Let me know if example usage code
would be needed. As for integration with SA I believe others are
more qualified, but I'm willing to help if needed.
If queries on whole subnets are required and frequent, my code
may not be the right choice (or should be extended).
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From radek@pld-linux.org 2006-06-22 16:30 -------
(In reply to comment #1)
> Note: it may be easier to get a new CPAN dependency added if it's a very
> widely-installed module. on that basis, Net::IP or NetAddr::IP may be more
> likely to be acceptable, since Ubuntu Dapper includes libnet-ip-perl and
> libnetaddr-ip-perl packages (but not libnetaddr-ip-lite-perl).
> also, I already have libnet-ip-perl installed, so some other package must have
> required it ;)
I guess that's because it's older. Net::IP isn't of very high quality, I've
included it just for reference. Uses Math::BigInt... for this purpose,
hard to justify.
Once the module is required by SA, it'll be included in distos promptly,
that I'm sure of. ;-)
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2007-01-24 10:05 -------
the "is net A within net B" code is infrequently used -- just whenever
trusted_networks / internal_networks is specified in a config file, so it's
efficiency isn't a big issue... but it *is* needed in some form, to support the
lint check where trusted_networks has to contain the entirety of the
internal_networks entries.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From Mark.Martinec@ijs.si 2007-01-25 01:10 -------
> the "is net A within net B" code is infrequently used -- just whenever
> trusted_networks / internal_networks is specified in a config file
Query on entire CIDR ranges may bring-in a new set of considerations.
When traversing a list of networks the following results may occur:
- no intersection with any entries, this one is easy;
- when same or a subset of some entry is found (and no previous matches)
this is fine, no ambiguities there, the matching entry from the list
provides the result (true/false) and search stops;
- when a query net is a superset of some entry from a list, what should happen?
Return a partial match and a result value corresponding to the first
partially matching entry, or continue scanning next entries in the list
for further matches, which may or may not fill-in missing pieces, but may
also provide conflicting results when giving opposite result values.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2007-01-24 08:02 -------
ping. if anyone wants to see IPv6 support in M:SA:NetSet, now's the time to do
up a patch -- it won't make it into 3.2.0 otherwise. Net::CIDR::Lite would be
the way to do it.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2007-03-02 02:19 -------
fwiw, Mail::SPF now uses NetAddr::IP, instead of Net::CIDR::Lite.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
jm@jmason.org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |4503
nThis| |
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From Mark.Martinec@ijs.si 2007-02-01 11:16 -------
> when a query net is a superset of some entry from a list, what should happen?
> Return a partial match and a result value corresponding to the first
> partially matching entry, or continue scanning next entries in the list
> for further matches, which may or may not fill-in missing pieces, but may
> also provide conflicting results when giving opposite result values.
Thinking aloud: one possibility on hitting a subset list entry of
a query is to split the query CIDR network into three (possibly empty)
ranges: below the matching range, above it, and the matching range.
Then do a recursive call on below- and above- ranges, and if both
results agree with the central section we have and answer.
Otherwise the conflict can not be resolved, there is no single
boolean answer to fit the query.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From Mark.Martinec@ijs.si 2006-06-23 15:52 -------
Just in case someone would be interested - as an alternative to bulky
IPv6-handling public Perl modules, I can offer a 160-line IPv4 and IPv6
parsing and matching code (240 lines with comments), which I wrote for
amavisd-new because at the time of writing (June 2004) none of the public
Perl modules filled my needs for rubustness, matching speed and not
depending on bulky further modules. Besides matching plain strings,
it also allows for a pre-parsed representation of static lookup lists,
which speeds up lookups agains the list. The syntax supported is
fully RFC-3513 compliant, thoroughly tested and in regular use.
For a quick view, here is a relevant code section snatched from
amavisd-new: http://ezri.ijs.si/~mark/lookup_ip_acl.pl
The code is maintained by me, but I don't have plans to make it into a
standalone Perl module, although I would not mind if someone else does it.
The code is GPL, but I can donate it to SA to fit the license.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
jm@jmason.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P5 |P1
------- Additional Comments From jm@jmason.org 2008-02-25 07:16 -------
I'm hoping to do this for 3.3.0
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
radek@pld-linux.org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |4994
nThis| |
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2006-06-22 16:15 -------
Note: it may be easier to get a new CPAN dependency added if it's a very
widely-installed module. on that basis, Net::IP or NetAddr::IP may be more
likely to be acceptable, since Ubuntu Dapper includes libnet-ip-perl and
libnetaddr-ip-perl packages (but not libnetaddr-ip-lite-perl).
also, I already have libnet-ip-perl installed, so some other package must have
required it ;)
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: removing custom code, using CPAN module
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
radek@pld-linux.org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |4956
nThis| |
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
jm@jmason.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Mark.Martinec@ijs.si
------- Additional Comments From jm@jmason.org 2007-01-24 08:03 -------
*** Bug 4965 has been marked as a duplicate of this bug. ***
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
------- Additional Comments From jm@jmason.org 2007-04-19 05:05 -------
ok, there's *yet another* factor to consider in the choice of module, now. ;)
It seems Net::DNS now requires Net::IP, and since Net::DNS is required in turn
by Mail::SpamAssassin, that means that if we use Net::IP, it will always be
available (and will be "free" in RAM terms, since it's already loaded for Net::DNS).
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 4964] Mail::SpamAssassin::NetSet: remove custom code, use CPAN module, support IPv6
Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4964
ask@idkom.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ask@idkom.de
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.