Hi,
> My aim is to create a variable for the local-domains field so I don't have
> to reconfigure everytime a new domain is added.
> So far, I have added the following to qmail-scanner-queue.pl.
> open(LIST,"/var/qmail/control/rcpthosts") || die "Unable to open
> rcpthosts\n";
> my @array = <LIST>;
> close(LIST);
> chomp(@array);
> my $localdom = join(",", @array);
> my @local_domains_array=('$localdom');
This is in general a good idea. I made something similar for spams that
should be rejected immediately. There was an Salvatore xxx who made some
extensions to qmail-scanner-1.22 (named it 1.22st). There are some good
ideas implemented (my opinion), but I didn't like the way of rejecting
spam-mails. We need a solution to define, for which domains spam-mails
should be rejected (default means do not reject spam-mails). So I made
some extensions to his code, especially reading a list of domains where
spams should be rejected if over spamassassins default level. I use
/var/qmail/control/spamreject as a list of domains, similar to the
rcpthosts file. So you may grab some of this code for your project.
sub-spamassassin.pl: include a call of a subroutine to check if sa_delete
should be lowered to 1 (means default+1):
$sa_delete=&spamrejecttest($one_recip,$sa_delete);
# this is placed before the following code in 1.22st:
# if ( $sa_delete && (($sa_delete+$required_hits)<$sa_score)) {
# if ( $sa_reject) {
sub-spamassassin.pl: add this new sub:
sub spamrejecttest {
##
## Aufruf: &spamrejecttest('[EMAIL PROTECTED]',15);
## Gibt 1 als sa_delete zurueck wenn domain in /var/qmail/control/spamreject gefunden
##
## $a = mailempfaenger
## $b = $sa_delete (default)
## $c = mailempfaeger vor @
## $d = mailempfaeger nach @ (domain)
##
my ($a,$b)[EMAIL PROTECTED];
tolower($a);
my ($c,$d)=split(/\@/,$a);
my ($i)='';
my @spamreject_array=('himmel.shlink.de','phportals.de','netgames.shlink.de');
if (-r "/var/qmail/control/spamreject")
{
open(SPAMREJECT,"/var/qmail/control/spamreject") || die "Unable to open
/var/qmail/control/spamreject\n";
@spamreject_array = <SPAMREJECT>;
close(SPAMREJECT);
chop(@spamreject_array);
}
## print "cc @spamreject_array\n";
&minidebug("SA: geladene spamrejects: @spamreject_array");
for ($i=0;$i<$#spamreject_array+1;$i++) {
chomp($spamreject_array[$i]);
tolower($spamreject_array[$i]);
## if ($spamreject_array[$i] =~ /$a$/i) {
if ($spamreject_array[$i] eq $d) {
&minidebug("SA: spam rejecten fuer $a (enthalten in $spamreject_array[$i])");
return 1;
} else {
&minidebug("SA: spam nicht rejecten fuer $a (nicht enthalten in
$spamreject_array[$i])");
}
}
return $b;
}
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general