shithub: riscv

ref: 7134d62ccbb32c783de67d26907e4e856c48f29c
dir: /sys/lib/dist/mail/lib/spam.rc/

View raw version
#!/bin/rc

rfork en
TMP=/tmp/spam.$sysname.$pid
sed '/^$/,$ s/^From / From /' >$TMP.msg
upas/fs -f $TMP.msg
{
	echo '# hash table'
upas/msgcat $TMP.msg | upas/msgtok |
	grep -v '^....................(.*)	'|
		sed 's/$/	1/'
} >$TMP.tok
cd /mail/box/$user
#cp $TMP.tok /tmp/_prof.spam
upas/addhash -o _prof.mbox _prof.mbox 1 $TMP.tok -1
upas/addhash -o _prof.spam _prof.spam 1 $TMP.tok 1
rm -f $TMP.*