From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: "Russ Cox" To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] white listing via upas/token Date: Mon, 1 Sep 2003 10:45:42 -0400 Topicbox-Message-UUID: 2815baba-eacc-11e9-9e20-41e7f4b1d025 Boyd, if you want to build a white list, all the mechanism is in /mail/lib/pipeto.lib already. Here's an example where bad mail gets spooled in another box _held, and then an example where it gets bounced back for a challenge-response. Russ g% cat pipeto.hold #!/bin/rc USER=rsc KEY=9fans-choate MAILTO=rsc@plan9.bell-labs.com # set up standard environment . /mail/lib/pipeto.lib $* # check against filter patterns filterstatus=`{tokenfilter $TMP.msg} switch($filterstatus){ case !match log dropped $RECIP From `{cat $D/replyto} # spool /mail/box/$USER/_dropped exit 0 case new log held $RECIP From `{cat $D/replyto} spool /mail/box/$USER/_held exit 0 case match token if(~ $filterstatus token) log added $RECIP From `{cat $D/replyto} spool $MBOX listupdate case * log unknown filter status $filterstatus spool $MBOX exit 'unknown filter status' } exit '' g% cat pipeto.token #!/bin/rc USER=rsc KEY=9fans-choate MAILTO=rsc@plan9.bell-labs.com # set up standard environment . /mail/lib/pipeto.lib $* # check against filter patterns filterstatus=`{tokenfilter $TMP.msg} switch($filterstatus){ case !match log dropped $RECIP From `{cat $D/replyto} # spool /mail/box/$USER/_dropped exit 0 case new log bounced $RECIP From `{cat $D/replyto} tokenreply # spool /mail/box/$USER/_token exit 0 case match token if(~ $filterstatus token) log added $RECIP From `{cat $D/replyto} spool $MBOX listupdate case * log unknown filter status $filterstatus spool $MBOX exit 'unknown filter status' } exit '' g%