#!/builddir/build/BUILD/plan9port-0_20260711git.337c6ac-build/plan9port-337c6acbfed51d8d9f08598c6cd398f53abcca7d/bin/rc

if (~ $#* 0)
	echo usage: unspambox mailfs/mbox && exit "usage"
box=$1
msgs=(`{9p ls $box>[2=1]|awk '$10 ~ /[0-9][0-9]*/{print $10}'})
if (~ $#msgs 0)
	echo no messages in $box && exit "none"

echo -n adding
for (m in $msgs){
	echo -n ' '$m
	unspam $box/$m
}
