You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Frederik Eaton <fr...@a5.repetae.net> on 2004/09/25 05:56:57 UTC

spamc interface suggestions

Hi,

I've been using spamc/spamd as part of my mail filter, and I've run
into a few problems with the interface it provides.

1. I want to start a spamd process (as myself) if one is not already
running. At first I thought spamc should at least have an option to
automatically spawn a spamd if necessary - this would be very clean
for the end user. But lacking that, I thought it should be easy to
write a script to run "spamc -x", try to start a spamd if there is a
non-zero exit code, and run "spamc" again without "-x". I ran into two
minor problems: "spamc -x" copies the message to standard output even
if it fails to connect to spamd, which means I need to save its output
to a temp file, then check the exit code, and cat the file only if the
exit code was zero. Somewhat unnecessarily messy. Secondly, with -x
and -R or -r, the exit code seems to be always zero, even when there
is a failure, contradicting the man page. More messiness for the
script-writer. Anyway, this is all work-around-able, but I imagine
users would like to have something which doesn't require such heavy
customization. (Ideally, there would be an option to spamassassin to
cause it to use or spawn a server on its own...)

2. The default mode, where the original message is output as a mime
attachment to a wrapper message, is not idempotent - it keeps adding
wrapper messages each time it goes through spamc:

$ < test-msg spamc -U .spamd-socket -x | wc -l                         
307
$ < test-msg spamc -U .spamd-socket -x | spamc -U .spamd-socket | wc -l
371
$ < test-msg spamc -U .spamd-socket -x | spamc -U .spamd-socket | spamc -U .spamd-socket| wc -l
435

So if one of my email accounts runs spamassassin automatically before
forwarding to my main account, and I run it again, ..., well things
get messy. Plus, this interacts poorly with other spam classification
schemes, which may modify only the headers - so now my spam folder is
a mixture of wrapped messages and normal messages, and it is difficult
to go through and extract all the original bodies and basic headers.
What I'm trying to say is that it would be nice to have a mode for
spamc (and spamassassin) where only the headers of a message are
modified.

Sorry if any of these suggestions seem frivolous! I guess it would be
redundant to say that spamassassin is doing a great job filtering my
email. I'm just mentioning some things that I think would be helpful
from an interface standpoint.

Frederik