1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/sh
# moderate owner distribution-alias
#
# ensure message gets redistributed to a distribution list alias yet
# error messages come back to the list owner. This requires invoking
# the mailer again.
#
# A mailing list is then set-up by adding aliases as follows: (articles are
# mailed to example, administrivia to example-request, error messages go back
# to example-owner, and the list of recipients is example-people).
#
# example: "|/local/lib/mail/bin/moderate example-owner example-people"
# example-request: lamy
# example-owner: lamy
# example-people: ":include:/local/share/mail/lists/example"
#
# note that your sendmail may not want the " around the :include, but
# that zmailer does in the name of RFC-822...
owner=$1;shift
recipients=$@
sed -e '1d' \
-e '2,/^$/{
/^[Ff][Rr][Oo][Mm]:/{
h;
s/^[Ff][Rr][Oo][Mm]:/Resent-Reply-To:/;
s/: */: /
x;
};
/^[Rr]eturn-[Pp]ath:/d;
s/^[Rr]esent-/Orig-Resent-/;
/^$/{
H;
g;
i\
Resent-From: '$owner'
i\
Resent-To: '$recipients'
};
}' | /usr/lib/sendmail -t -f$owner
|