* [9fans] white listing via upas/token
@ 2003-09-01 14:45 Russ Cox
0 siblings, 0 replies; only message in thread
From: Russ Cox @ 2003-09-01 14:45 UTC (permalink / raw)
To: 9fans
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%
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-01 14:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-01 14:45 [9fans] white listing via upas/token Russ Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).