domain based RBLs
Peter Peters
P.G.M.Peters at civ.utwente.nl
Tue Jun 4 10:43:37 IST 2002
I have been looking at name based RBLs like RFC-ignorant. With the
current MailScanner only IP-based zones are supported (through "Spam
List").
I have been hacking away in config.pl and sendmail.pl to try to get the
other RBLs at rfc-ignorant.org to work. I have introduced a new config
"Spam Domain List" with the same format as "Spam List". At this moment
it seems to work on my test-system.
In mailscanner.conf:
Spam Domain List = RFC-IGNORANT-DSN, dsn.rfc-ignorant.org.
Spam Domain List = RFC-IGNORANT-POSTMASTER, postmaster.rfc-ignorant.org.
Spam Domain List = RFC-IGNORANT-ABUSE, abuse.rfc-ignorant.org.
Spam Domain List = RFC-IGNORANT-WHOIS, whois.rfc-ignorant.org.
My diffs:
diff -u sendmail.pl sendmail.pl-new
--- sendmail.pl Wed May 29 13:59:12 2002
+++ sendmail.pl-new Tue Jun 4 11:31:12 2002
@@ -233,6 +233,17 @@
if ($RBLEntry =~ /^127\.[01]\.0\.[1234567]$/);
}
}
+
+ # Check domain based RBLs
+ for ($i=0; $i<@Config::SpamDNames; $i++) {
+ # Look up $fromdomain in each of the @Config::SpamDDomains we have
+ $RBLEntry = gethostbyname("$fromdomain." . $Config::SpamDDomains[$i]);
+ if ($RBLEntry) {
+ $RBLEntry = Socket::inet_ntoa($RBLEntry);
+ push @RBLs, $Config::SpamDNames[$i]
+ if ($RBLEntry =~ /^127\.[01]\.0\.[1234567]$/);
+ }
+ }
if (@RBLs) {
$SpamHeader = join(', ', @RBLs);
$IsSpam->{$mID} = 1;
diff -u config.pl config.pl-new
--- config.pl Wed May 29 13:59:12 2002
+++ config.pl-new Tue Jun 4 11:29:24 2002
@@ -267,6 +267,15 @@
push @Config::SpamNames, $spamn;
push @Config::SpamDomains, $spamd;
}
+ # Build up the list of spam RBL lists based on domain names (e.g.
+ # "RFC-IGNORANT-DSN, dsn.rfc-ignorant.org.") out of multiple
+ # "spamdomainlist" configuration lines
+ if ($key =~ /^spamdomainlist/i) {
+ my($spamn, $spamd);
+ ($spamn, $spamd) = split(/[, ]+/, $value);
+ push @Config::SpamDNames, $spamn;
+ push @Config::SpamDDomains, $spamd;
+ }
}
close CONF;
--
Peter Peters
senior netwerkbeheerder, Centrum voor Informatievoorziening,
Universiteit Twente, Postbus 217, 7500 AE Enschede
telefoon: +31 53 489 2301, fax:+31 53 489 2383, http://www.utwente.nl/civ
More information about the MailScanner
mailing list