I was given a task to write a Java program that gets user input as text from a GUI screen, create a Spamassassin rule according to that rule and test the rule against a set of .eml files.

Therefore I think a should call spamassassin process with some arguments and get the processes return value. Is it possible to achieve this?

1 Answer 1


When you call spamassassin with -h you get the help:

-e, --exit-code                   Exit with a non-zero exit code if the
                                  tested message was spam

and you can set the configuration directory using -C, so you don't have to clutter the normal configuration when adding your "rules"

You just call spamassassin with these options and some email to test against as argument from your program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .