xref: /plan9/sys/src/cmd/upas/filterkit/pipefrom.sample (revision 0c0e9c72e4142bf389aae0e4315af853b386f691)
1#!/bin/rc
2
3rfork e
4TMP=/tmp/myupassend.$pid
5
6# collect upas/send options
7options=()
8while (! ~ $#* 0 && ~ $1 -*) {
9	options=($options $1);
10	shift
11}
12
13# collect addresses and add them to my patterns
14dests=()
15while (! ~ $#* 0) {
16	dests=($dests $1);
17	shift
18}
19echo $dests > $TMP
20upas/list add /mail/box/$user/_pattern $TMP >[2] /dev/null
21rm $TMP
22
23# send mail
24upas/send $options $dests
25