[Mimedefang] conditional SALocalTestsOnly ?

Ole Craig olc at cs.umass.edu
Tue May 20 16:53:01 EDT 2003


On 05/20/03 at 10:21, 'twas brillig and Ole Craig scrobe:
> On 05/19/03 at 21:24, 'twas brillig and David F. Skoll scrobe:
> 
> > On Mon, 19 May 2003, Ole Craig wrote:
> > 
> > > 	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?
> > 
> > It's worse than that: $SALocalTestsOnly is used only when the
> > SpamAssasin object is created, and never again.  So it's extremely difficult
> > to do what you want using SpamAssassin.
> > 
> > However, you can easily do lookups conditionally using MIMEDefang's
> > built-in relay_is_blacklisted() function, and adjust the SA score
> > yourself.
> 
> 	Booger. I'm assuming relay_is_blacklisted() doesn't do any
> prior-hop (Received: ) checking; am I right?
> 
> 	How difficult would it be to instantiate two SpamAssassin
> objects (one with nettests, one without) and choose between them at
> runtime?

	Ok, let me rephrase that question: in your opinion, how
*expensive* would it be to instantiate two SA objects? I went ahead
and hacked this into mimedefang.pl -- essentially, I just copied
spam_assassin_init to spam_assassin_net_init, gave
spam_assassin_status another object, and had it call the new object
conditionally on the value of a new global variable that I'm switching
in filter_begin, just before calling spam_assassin_check. (I realized
belatedly that just because filter_relay is where one first has access
to the relay IP doesn't mean it's the place I want to do my
checking...)


		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