Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
if (~ $#USER 0)
4
	USER=$user
5
cd /mail/box/$USER
6
rfork en
7
 
8
TMP=/tmp/spam.$sysname.$pid
9
sed '/^$/,$ s/^From / From /' >$TMP.msg
10
upas/fs -f $TMP.msg
11
{
12
	echo '# hash table'
13
	upas/msgcat $TMP.msg | upas/msgtok |
14
		grep -v '^....................(.*)	' |
15
		sed 's/$/	1/'
16
	} >$TMP.tok
17
 
18
x=`{upas/bayes -k _prof.mbox _prof.spam ~ $TMP.tok}
19
#echo xx $x xx >>/tmp/spam
20
#ls -l _prof.mbox _prof.spam  $TMP.tok>>/tmp/spam
21
where=$x(1)
22
prob=$x(2)
23
echo $where $prob
24
*=($x)
25
shift 2
26
while(! ~ $#* 0){
27
	echo '	' $1 $2
28
	shift 2
29
}
30
rm -f $TMP.tok $TMP.msg
31
if (~ $where *spam*){
32
	exit ''
33
}
34
if not {
35
	exit 'is ok'
36
}