From: presotto@plan9.bell-labs.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] upas/token
Date: Wed, 3 Jul 2002 15:48:04 -0400 [thread overview]
Message-ID: <761b70db34a4c6ffa28563f2265ef944@plan9.bell-labs.com> (raw)
[-- 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
next reply other threads:[~2002-07-03 19:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-03 19:48 presotto [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-07-04 8:19 Richard Miller
2002-07-03 16:11 Richard Miller
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=761b70db34a4c6ffa28563f2265ef944@plan9.bell-labs.com \
--to=presotto@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).