9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] upas/token
@ 2002-07-04  8:19 Richard Miller
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Miller @ 2002-07-04  8:19 UTC (permalink / raw)
  To: 9fans

Thanks for the explanation.

The example rejection message in /sys/src/cmd/upas/filterkit/pipeto.sample
shows clearly what upas/token is useful for.  I was going to suggest that
mail(1) should contain a pointer to this sample file, but I see it already
does.  I should have RTFM more carefully.

-- Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] upas/token
@ 2002-07-03 19:48 presotto
  0 siblings, 0 replies; 3+ messages in thread
From: presotto @ 2002-07-03 19:48 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

My mail filter adds addresses to my list of acceptable senders if it finds
a valid token in the subject line.

To create a token that is a function of the string xyzzy and today's date.

	% upas/token xyzzy
	2taC2
	%

To see if a token is one created in the last 10 days

	% echo some line containing 2taC2 > /tmp/quux
	% if ( upas/token xyzzy /tmp/quux )
		echo hi
	hi
	%

In /sys/src/cmd/upas/filterkit/pipeto.sample you'll find:

	# save and parse the mail file
	{sed '/^$/,$ s/^From / From /'; echo} > $TMP
	upas/fs -f $TMP

	# if we like the source
	# or if the subject contains a valid token
	# then deliver the mail and allow all the addresses

	...

	if ( $BIN/token $KEY $D/subject )
	{
		$BIN/deliver $RECIP $D/from $MBOX < $D/raw
		$BIN/list add $PF $D/from $D/to $D/cc $D/sender
		rm $TMP
		echo `{date} added $RECIP From `{cat $D/replyto} \
			>> /mail/box/$USER/_bounced >[2] /dev/null
		exit 0
	}

The first bit just uses upas/fs to present the message to be filtered as
a file system.  The last part looks to see if a valid token exists
in the Subject: line and if so adds the address to the list of patterns.

Of course, there's no reason to use upas/token.  You could just as
easily have a single token that's good for all time.  I just thought
that would make it a little to easy for the spammers.

[-- Attachment #2: Type: message/rfc822, Size: 1274 bytes --]

From: Richard Miller <miller@hamnavoe.demon.co.uk>
To: 9fans@cse.psu.edu
Subject: [9fans] upas/token
Date: Wed, 3 Jul 2002 17:11:33 0100
Message-ID: <20020703161148.C5E6C199B7@mail.cse.psu.edu>

What is it for?  I'm sure it should be obvious, but I can't see it.

-- Richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] upas/token
@ 2002-07-03 16:11 Richard Miller
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Miller @ 2002-07-03 16:11 UTC (permalink / raw)
  To: 9fans

What is it for?  I'm sure it should be obvious, but I can't see it.

-- Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-04  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-04  8:19 [9fans] upas/token Richard Miller
  -- strict thread matches above, loose matches on Subject: below --
2002-07-03 19:48 presotto
2002-07-03 16:11 Richard Miller

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).