Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!giza.cis.ohio-state.edu!karl_kleinpaste From: karl_kleinpaste@giza.cis.ohio-state.edu Newsgroups: comp.mail.sendmail Subject: Re: Mailing list remailer Message-ID: Date: 10 Apr 90 13:47:35 GMT References: <175@brazil.cambridge.apple.com> Sender: usenet_news@tut.cis.ohio-state.edu Organization: Ohio State Computer Science Lines: 216 gz@cambridge.apple.com writes: Does anybody have a program that would add Errors-To: lines to headers or maybe massage the return-path or whatever else seems appropriate for automatically remailing messages to a large mailing list in such a way that errors get reported to the list maintainers? Thanks. #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # Aliases # README # Reject # SendScript-complex # SendScript-simple # Unauthorized # usr-lib-aliases # This archive created: Mon Feb 19 17:09:12 1990 # By: Karl Kleinpaste (OSU) export PATH; PATH=/bin:$PATH echo shar: extracting "'Aliases'" '(59 characters)' if test -f 'Aliases' then echo shar: will not over-write existing file "'Aliases'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'Aliases' KKsample@address.number1.edu KKsample!address!number2!somebody MAILING-LIST-MGMT if test 59 -ne "`wc -c < 'Aliases'`" then echo shar: error transmitting "'Aliases'" '(should have been 59 characters)' fi fi # end of overwriting check echo shar: extracting "'README'" '(1237 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'README' KKIn the shar file you have just unpacked, you should have found: KK KKREADME This file. KKAliases Sample aliases file. KKReject Sample rejection notice for use KK with SendScript-complex. KKSendScript-complex Control script which provides a "fire extinguisher." KKSendScript-simple Simplistic, mindless control script. KKUnauthorized Sample file of unauthorized posters, for KK use with SendScript-complex. KKusr-lib-aliases Sample alias configuration for putting it all to use. KK KKIf you don't need to prevent obnoxious users from posting to the KKlist(s) you mange, toss Reject, Unauthorized, and SendScript-complex. KK KKFor simple lists, install the appropriate variations on KKusr.lib.aliases into your own /usr/lib/aliases, create the directory KKfrom which the list will be managed, and place the Aliases and KKSendScript file there, modifying SendScript's "address" and "domain" KKvariables appropriately. KK KKFor complex lists requiring the fire extinguisher, do the above, but KKuse SendScript-complex as SendScript, and include the (edited) Reject KKmessage, plus an initially empty Unauthorized file. KK KKDon't forget to rerun newaliases so that the alias updates take KKeffect. KK KK--karl kleinpaste KKPesonification of the Mailer Daemon KKOhio State Computer Science MAILING-LIST-MGMT if test 1237 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 1237 characters)' fi chmod +x 'README' fi # end of overwriting check echo shar: extracting "'Reject'" '(219 characters)' if test -f 'Reject' then echo shar: will not over-write existing file "'Reject'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'Reject' KKThe following note has been rejected by the "fire extinguisher" of the KK mailing list. If you wish to question the rejection, KKplease send your note to the list maintainer. KK KK--Karl Kleinpaste KKList Maintainer KK MAILING-LIST-MGMT if test 219 -ne "`wc -c < 'Reject'`" then echo shar: error transmitting "'Reject'" '(should have been 219 characters)' fi fi # end of overwriting check echo shar: extracting "'SendScript-complex'" '(1321 characters)' if test -f 'SendScript-complex' then echo shar: will not over-write existing file "'SendScript-complex'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'SendScript-complex' KK#!/bin/csh -f KK# CONFIG HERE. KKset dir=/directory/used/for/list/maintenance KKset address=list-name KKset domain=your.domain.name KKset path=(/usr/local/bin /usr/ucb /bin /usr/bin) KK# KK# Prepare for cleanup KKset tmp1=/tmp/list.1.$$ KKset tmp2=/tmp/list.2.$$ KKset tmp3=/tmp/list.3.$$ KK# KK# Save the incoming mail, then find the From: line KKcat - > $tmp1 KKgrep '^From: ' $tmp1 | head -1 | sed -e 's/^From: //' > $tmp2 KK# KK# Determine if it's "name " or "add@re.ss (name)." KKgrep -s '<' $tmp2 >& /dev/null KKif ($status == 0) then KK # Address contained within <> KK sed -e 's/^.*<\(.*\)>.*$/\1/' < $tmp2 > $tmp3 KKelse KK # Address in any other form KK sed -e 's/(.*)//' -e 's/".*"//' -e 's/ //' < $tmp2 > $tmp3 KKendif KK# KK# Look for that address in the Unauthorized file. KKfgrep -i -s -f $dir/Unauthorized $tmp3 >& /dev/null KKif ($status == 0) then KK # Reject. KK cat $dir/Reject $tmp1 | Mail -s 'Rejected note' \ KK `cat $tmp3` $address-request@$domain KKelse KK # Accept. KK cat $tmp1 | sed -e '/^Reply-To:/d' -e '/^Sender:/d' -e '/^From /d' | \ KK (echo Errors-to: $address-request@$domain; \ KK echo Sender: $address-request@$domain; \ KK echo Reply-To: $address@$domain; \ KK echo Precedence: bulk; \ KK cat -) | \ KK /usr/lib/sendmail -f $address-request@$domain \ KK -F "$address Mailing List" $address-out KKendif KK# KK# Done. KKrm -f $tmp1 $tmp2 $tmp3 KKexit 0 MAILING-LIST-MGMT if test 1321 -ne "`wc -c < 'SendScript-complex'`" then echo shar: error transmitting "'SendScript-complex'" '(should have been 1321 characters)' fi chmod +x 'SendScript-complex' fi # end of overwriting check echo shar: extracting "'SendScript-simple'" '(397 characters)' if test -f 'SendScript-simple' then echo shar: will not over-write existing file "'SendScript-simple'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'SendScript-simple' KK#!/bin/csh -f KKset address=list-name KKset domain=your.domain.name KK/bin/sed -e '/^Reply-To:/d' -e '/^Sender:/d' -e '/^From /d' | \ KK (echo Errors-to: $address-request@$domain; \ KK echo Sender: $address-request@$domain; \ KK echo Reply-To: $address@$domain; \ KK echo Precedence: bulk; \ KK /bin/cat -) | \ KK /usr/lib/sendmail -f $address-request@$domain \ KK -F "$address Mailing List" $address-out KKexit 0 MAILING-LIST-MGMT if test 397 -ne "`wc -c < 'SendScript-simple'`" then echo shar: error transmitting "'SendScript-simple'" '(should have been 397 characters)' fi chmod +x 'SendScript-simple' fi # end of overwriting check echo shar: extracting "'Unauthorized'" '(89 characters)' if test -f 'Unauthorized' then echo shar: will not over-write existing file "'Unauthorized'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'Unauthorized' KKsample-nasty-username%some.domain.com@relay.cs.net KKsample-nasty-username@some.domain.com MAILING-LIST-MGMT if test 89 -ne "`wc -c < 'Unauthorized'`" then echo shar: error transmitting "'Unauthorized'" '(should have been 89 characters)' fi fi # end of overwriting check echo shar: extracting "'usr-lib-aliases'" '(231 characters)' if test -f 'usr-lib-aliases' then echo shar: will not over-write existing file "'usr-lib-aliases'" else sed 's/^KK//' << \MAILING-LIST-MGMT > 'usr-lib-aliases' KKlist-name-request: karl KKlist-name: "|/directory/used/for/list/maintenance/SendScript" KKowner-list-name: list-name-request KKlist-name-out: :include:/directory/used/for/list/maintenance/Aliases KKowner-list-name-out: list-name-request MAILING-LIST-MGMT if test 231 -ne "`wc -c < 'usr-lib-aliases'`" then echo shar: error transmitting "'usr-lib-aliases'" '(should have been 231 characters)' fi fi # end of overwriting check # End of shell archive exit 0