3 # create a /tmp for here documents
12 PF=/mail/box/$USER/_pattern
13 TMP=/mail/tmp/mine.$pid
17 # save and parse the mail file
18 {sed '/^$/,$ s/^From / From /'; echo} > $TMP
21 # if we like the source
22 # or if the subject contains a valid token
23 # then deliver the mail and allow all the addresses
24 if( $BIN/list check $PF $D/from $D/sender $D/replyto )
26 $BIN/deliver $RECIP $D/from $MBOX < $D/raw
27 $BIN/list add $PF $D/from $D/to $D/cc $D/sender
33 echo `{date} dropped $RECIP From `{cat $D/replyto} >> /mail/box/$USER/_bounced >[2] /dev/null
37 if ( $BIN/token $KEY $D/subject )
39 $BIN/deliver $RECIP $D/from $MBOX < $D/raw
40 $BIN/list add $PF $D/from $D/to $D/cc $D/sender
42 echo `{date} added $RECIP From `{cat $D/replyto} \
43 >> /mail/box/$USER/_bounced >[2] /dev/null
47 # don't recognize the sender so
48 # return the message with instructions
49 TOKEN=`{upas/token $KEY}
51 {{cat; cat $D/raw} | upas/send `{cat $D/replyto}}<<EOF
52 Subject: $USER's mail filter
53 I've been getting so much junk mail that I'm resorting to
54 a draconian mechanism to avoid the mail. In order
55 to make sure that there's a real person sending mail, I'm
56 asking you to explicitly enable access. To do that, send
57 mail to $USER at this domain with the token:
59 in the subject of your mail message. After that, you
60 shouldn't get any bounces from me. Sorry if this is
68 echo `{date} bounced $RECIP From `{cat $D/replyto} \
69 >> /mail/box/$USER/_bounced >[2] /dev/null