From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <06d2d0989ee04938acc6ac0bfc0a6ecb@plan9.bell-labs.com> From: David Presotto To: 9fans@cse.psu.edu Subject: Re: [9fans] mail In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Mon, 1 Sep 2003 09:54:59 -0400 Topicbox-Message-UUID: 2748f9b2-eacc-11e9-9e20-41e7f4b1d025 If you run upas/fs over the mail message in your pipetp, you can get at any of the fields. For example: #!/bin/rc # create a /tmp for here documents rfork en bind -c /mail/tmp /tmp RECIP=$1 MBOX=$2 PF=/mail/box/$USER/_pattern TMP=/mail/tmp/mine.$pid BIN=/bin/upas D=/mail/fs/mbox/1 # save and parse the mail file {sed '/^$/,$ s/^From / From /'; echo} > $TMP upas/fs -f $TMP # accept anything sent to license-discuss if( grep -si license-discuss@opensource.org $D/to || grep -si license-discuss@opensource.org $D/cc || grep -si license-discuss@opensource.org $D/from ) { $BIN/deliver $RECIP $D/from $MBOX < $D/raw rv=$status rm $TMP exit $rv } # throw out anything from boyd at his non insultant address if( grep -si 'boyd@(.*\.)?sdgm.net' $D/from ) { $BIN/deliver $RECIP $D/from $MBOX.bounced < $D/raw rv=$status rm $TMP exit $rv } # dump it if the sender is spoofing me if( grep -si '^x-warning: suspect .* domain$' $D/rawheader && grep $USER $D/from) { $BIN/deliver $RECIP $D/from $MBOX.bounced < $D/raw rv=$status rm $TMP exit $rv } ...