From f1007ee0c6a2dfdc5512a1be3dada65cbc5d5391 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 21 May 2006 18:39:29 +0000 Subject: new --- bin/upas/isspam | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 bin/upas/isspam (limited to 'bin/upas/isspam') diff --git a/bin/upas/isspam b/bin/upas/isspam new file mode 100755 index 00000000..03be23f7 --- /dev/null +++ b/bin/upas/isspam @@ -0,0 +1,35 @@ +#!/usr/local/plan9/bin/rc + +rfork en + +if (~ $#* 0) + echo usage: isspam mesg && exit 'usage' + +TMP=/tmp/isspam.$USER.$pid +{ + echo '# hash table' + msgcat $1|sed '/^$/,$ s/^From / From /'|upas/msgtok| + grep -v '^....................(.*) '| + sed 's/$/ 1/' +} >$TMP.tok + +x=`{upas/bayes -k $HOME/mail/_prof.mbox $HOME/mail/_prof.spam ~ $TMP.tok} +where=$x(1) +prob=$x(2) +echo $where $prob +*=($x) +shift 2 +while(! ~$#* 0){ + echo ' ' $1 $2 + shift 2 +} + +rm -f $TMP.tok +if (~ $where *spam*){ + echo spam + exit '' +} +if not { + echo ok + exit 'is ok' +} -- cgit v1.2.3