On 7/30/2010 12:14 PM, Adam Moskowitz wrote:
> Earlier today, I wrote:
>> I want to use spamassassin's per-user whitelisting as part of some mail
>> processing I'm doing.
>> . . .
>> spamassassin takes a long time to load and run
>> . . .
>> Can I arrange to load/run only the tests I need? If so, how?
> Sorry, I should have made a few things clear:
>
> 1) This is not part of mail delivery; it's separate post-delivery
> processing I'm running on my mail. Think "analysis," but not quite.
>
> 2) Since all this happens infrequently, I don't want to leave a spamd
> running all the time.
>
> 3) While I could fire up a non-standard spamd, throw messages at it,
> then close it down when I'm done, I'd rather not add the complication of
> managing the start-up/shut-down of a daemon.

service spamd start
- run your stuff
service spamd stop

> 4) Yes, I know running spamassassin on each message is inefficient; in
> this case, that's OK -- but if I can reduce the running time from 1.5
> seconds per message to, say, 0.5 seconds, that's worth it to me.

You say you don't care if it's inefficient, but then you say you need to
reduce the scan time for each message.  Which is it?

If you are getting 1.5 seconds runtime out of calling spamassassin for a
message, I would say you are doing very well.  On the other hand, if
that is the reported scantime, there is probably another additional
second or so actually being used to start spamassassin each time.  If
this is the case, you could probably save a substantial amount of time
by using spamc/spamd even though the reported scantimes would remain the
same.

> 5) Yes, I'm sure lots of people could make arguments for better ways to
> do this -- but given this is being fitted into some existing old and
> crufty code, it's the easiest way *for me* in terms of the amount of
> work I'd have to do.

I still say the simplest thing to do -- and the thing that would make
the most difference is to use spamd.  spamc is a drop-in replacement for
spamassassin, so you don't even need to change anything in your existing
code except replacing 'spamassassin' with 'spamc'.  Just make sure you
start the daemon before it runs -- which, as I mentioned above, isn't
really a big deal.

-- 
Bowie

Reply via email to