mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
19 lines
390 B
Bash
Executable file
19 lines
390 B
Bash
Executable file
#!/usr/local/plan9/bin/rc
|
|
|
|
rfork en
|
|
|
|
if (~ $#* 0)
|
|
echo usage: unspam mesg && exit 1
|
|
|
|
TMP=/tmp/unspam.$USER.$pid
|
|
{
|
|
echo '# hash table'
|
|
msgcat $1|sed '/^$/,$ s/^From / From /'|upas/msgtok|
|
|
grep -v '^....................(.*) '|
|
|
sed 's/$/ 1/'
|
|
} >$TMP.tok
|
|
|
|
cd $home/mail
|
|
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.*
|