C-Command Software Forum

Classify email using the command line


I would like to use SpamSieve with exotic mail readers (gnus in emacs, to be precise), and I am wondering if it is possible to call SpamSieve from the command line, or if the feature is planned.

More precisely, what I would like is to be able to call SpamSieve with the path to a message (or give it directly the contents of the message), and it would return with a spam level that I could use to move the message myself. In addition, it would be great if I could also train SpamSieve from the command line using a similar approach.



There’s no command-line interface, but you could certainly use the osascript command to talk to SpamSieve via AppleScript. For example, your script could take a path to a message (in argv), read it in, send it to SpamSieve for analysis, and print the score.

Ah, thank you for the suggestion. I have indeed not looked at the AppleScript dictionary for SpamSieve.