[Mimedefang] conditional SALocalTestsOnly ?

Ole Craig olc at cs.umass.edu
Mon May 19 12:57:01 EDT 2003


	I've been playing a bit with letting SA check various RBLs;
while I don't feel I can outright block connections from potential ORs
I do like the idea of letting that information boost the SA score. 

	Whilst I was experimenting, my server load average didn't
noticeably jump, but I did get some complaints from the more prolific
folks onstaff that Pine started to take noticeable amounts of time
(say, 20 seconds or so) to finish some SMTP transactions.
(spamassassin config has rbl_timeout set to 4.)

	So what I'd like to do is set the value of $SALocalTestsOnly
within filter_relay, so that connections from local IPs don't get hit
with the overhead of RBL lookup. (Another possibility might be setting
a flag such that local messages don't get scanned at all, but I'm less
interested in that.)

	However, mimedefang-filter(5) has a section "GLOBAL VARIABLE
LIFETIME" that states in part:

       If you set a global variable:
	[...]
       In filter_relay, filter_sender or filter_recipient
              Not guaranteed to be available to any other function
	[...]


	My question is, do I have to go through the rigamarole of
creating a file for state purposes in $CWD, or is $SALocalTestsOnly
not subject to the stated rule?

	Here's what I have for a potential filter_relay:
sub filter_relay ($$$) {
    my ($ip, $hname, $helo) = @_;
    if ($ip =~ /((128\.119\.240.[\d]{1,3})|(127\.0\.0\.[\d]{1,3}))/) {
	md_syslog("debug","local ip=$ip, disabling nettests");
	$SALocalTestsOnly = 1;
    } else {
	md_syslog("debug","foreign ip=$ip, enabling nettests");
	$SALocalTestsOnly = 0;
    }
    return ('CONTINUE', "ok");
}


		Ole
-- 
Ole Craig * UNIX, linux, SMTP-ninja; news, web; SGI martyr * CS Computing
Facility, UMass * <www.cs.umass.edu/~olc/pgppubkey.txt> for public key
[...] Oh, shed thy mercy and thy grace / On those who venture into space.
			(R. A. Heinlein)



More information about the MIMEDefang mailing list