Sylpheed is a really cool mail program. Less icons than thunderbird, but very fast and gets the job done well.
Junk mail filtering is not integrated, which makes sense since there are great products out there that we should reuse.
Sylpheed provides external program calls, and a preset option fills them out for bsfilter and bogofilter. However, my favorite, spamassassin is not a preset.
Learning command for Junk: sa-learn --spam
Learning command for Not Junk: sa-learn --ham
Classifying command: (see following text)
As a classifying command, sylpheed expects (like bogofilter):
0 for spam; 1 for non-spam; 2 for unsure
However, spamassassin returns:
0 for non-spam, 5 for spam
So, use save the following script in /home/user/.spamassassin/spamcheck.sh:
#!/bin/bash
# return
# 0 for spam; 1 for non-spam; 2 for unsure ; 3 for I/O or other errors.
# spamassessin returns
# 0 for non-spam, 5 for spam
spamassassin -e "$1"
RETURN="$?"
[[ "$RETURN" == "0" ]] && exit 1
[[ "$RETURN" == "5" ]] && exit 0
exit 2
Set it in sylpheed as classifying command:
bash /home/user/.spamassassin/spamcheck.sh
If you want to save 0.1 seconds per call, compile the attached C file spamcheck (c, 2 KB) with
gcc -Wall -Wextra -Werror -ansi -pedantic -o spamcheck spamcheck.c
and use the outcoming spamcheck executable instead.
Recent Comments