9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: [9fans] white listing via upas/token
Date: Mon,  1 Sep 2003 10:45:42 -0400	[thread overview]
Message-ID: <fd72d53098289741cfb3d5d32e38ae6d@plan9.bell-labs.com> (raw)

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%



                 reply	other threads:[~2003-09-01 14:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd72d53098289741cfb3d5d32e38ae6d@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).