On Sun, 24 Jan 2016, Reindl Harald wrote:
Am 24.01.2016 um 20:45 schrieb Shawn Bakhtiar:
On Jan 24, 2016, at 11:29 AM, Martin Gregorie <[email protected]> wrote:
On Mon, 2016-01-25 at 00:07 +0530, Sarang Shrivastava wrote:
I am just a newbie who has started using SA. Someone on the mailing
list suggested me to use -D option. So if this option is for
debugging then how do we classify it ?
You don't classify it: that's SA's job. It only scores messages and
sets the Yes/No flag before adding the X-Spam-* headers to the message.
Nothing else. What you do with mail that SA has classified as spam is
the responsibility of your additional software and/or your users.
[snip..]
* the point is that he is analyzing *local* files
* so he needs to pass eml files to spamc/spamassassin
* SA adds a header "X-Spam-Flag: Yes" in case of it reached spam-score
* that output needs to be parsed
* that's it
Simpler yet, get spamd running and just use "spamc -c < mail.eml"
It emits a score and sets the exit code.
No "parsing" needed, just test the exit code.
EG, suppose I have two messages, one known ham "ham.eml" and one known
spam "spam.eml"
Then:
if (spamc -c < spam.eml ) ; then
echo "is ham"
else
echo "is spam"
fi
will execute the 'echo "is spam"' clause
and if you feed it the ham.eml will execute the 'echo "is ham"' clause.
( this presupposes a bash shell varient, coding for other shell types is
left as an exercise for the reader. ;)
--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{