From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <761b70db34a4c6ffa28563f2265ef944@plan9.bell-labs.com> From: presotto@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] upas/token MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-foykqkgsbonqnjzypsgsmfozju" Date: Wed, 3 Jul 2002 15:48:04 -0400 Topicbox-Message-UUID: c1026c48-eaca-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-foykqkgsbonqnjzypsgsmfozju Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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. --upas-foykqkgsbonqnjzypsgsmfozju Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Wed Jul 3 12:12:14 EDT 2002 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Wed Jul 3 12:12:13 EDT 2002 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.20.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 1ECF8199E3; Wed, 3 Jul 2002 12:12:06 -0400 (EDT) Delivered-To: 9fans@cse.psu.edu Received: from hamnavoe (hamnavoe.gotadsl.co.uk [213.208.117.150]) by mail.cse.psu.edu (CSE Mail Server) with SMTP id C5E6C199B7 for <9fans@cse.psu.edu>; Wed, 3 Jul 2002 12:11:48 -0400 (EDT) To: 9fans@cse.psu.edu From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020703161148.C5E6C199B7@mail.cse.psu.edu> Subject: [9fans] upas/token Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Wed, 3 Jul 2002 17:11:33 0100 What is it for? I'm sure it should be obvious, but I can't see it. -- Richard --upas-foykqkgsbonqnjzypsgsmfozju--