[EMAIL PROTECTED] wrote:
On Tue, 23 May 2006, John Peacock wrote:
[EMAIL PROTECTED] wrote:
I am wondering if people might have ideas for running two
spamassassin plugins, each using a different set of configurations.
Strange setup, yes - a unique situation where I'd like to take advantage
of spamassassin's functionality for another purpose.
You'll probably want to tell us that that other purpose is, so we can more
appropriately help you. spamassassin is pretty heavy code to be running twice
(if not just once) on every message. There may be a better way to do what you
intend, but my psychic powers are too weak to determine what that might be...
;-)
Nothing mysterious. Just need to look for certain subjects,
keywords in the body, and URIs, maybe contents of some headers. However,
these apply to specific domain recipients. This purpose would actually run
first, and if a match was found, the second (standard spamassassin)
wouldn't run, anyway. Spamassassin's functionality, since already,
essentially, available, could be easier to use than writing my own, as it
handles URIs across boundaries, etc. The other difference, though, is that
it would only take one match to be a hit, so it would be unnecessary to
continue with tests, but that's life, sometimes.
Were you looking to save time/cpu with the first pass before hitting all
of the tests?
Some of the items above (headers, subject, domain recipients) would be
easy to do as a qpsmtpd plugin. The body would be a more tricky
proposition, as you mentioned (URIs across boundaries) in your email.
The headers would be an easy plugin, though. Easier, at least, than
modifying spamassassin (I think.)
If you wanted to avoid running spamassassin if the checks were
discovered, simply store a flag in the transaction notes:
if ($found_a_match) {
$self->qp->transaction->notes('check_spamassassin', 'no');
}
and then modify spamassassin's plugin like so:
return DECLINED
if ($self->qp->transaction->notes('check_spamassassin') eq 'no');
or something like that.