Subject: v25i035: listserv5.31 - mailing list management system, Part01/06 Newsgroups: comp.sources.unix Approved: vixie@pa.dec.com Submitted-By: tasos@cs.bu.edu Posting-Number: Volume 25, Issue 35 Archive-Name: listserv5.31/part01 This is a system that implements various discussion lists with one list server. It is automated, and obliterates the need for user intervention and maintenance of multiple aliases of the form "list, list-owner, list-request", etc. There is support provided for archives, moderated lists, peer lists, news connections and gateways, and mail queuing. [ Essentially, this is bunch of tools that lets people subscribe, unsubscribe, and get various info about mailing lists automatically. The tools take incoming mail for the list(s) and distribute them to the active subscribers. It also provides an interface (via mail) for archives, allowing remote users to list and retreive things from the archive. The main hook for the system is through the machine's aliases file. All incoming mail is dumped into a queue for the various lists, and then the tools that he provide process the queues. I think that this is a pretty useful system. It would be neat if it gained wide-spread usage. --Nick ] [ I am sad to see that the man pages are not in source form; this practice is hereby discouraged in all future postings. --vix ] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh '.awk' <<'END_OF_FILE' X{ X tabcol = 40; X l = 0; X if (length ($1) < tabcol) X l = int ((tabcol + 7 - length ($1)) / 8); X printf "%s", $1; X k = 8 - int ((length ($1) % 8)); X for (i = 0; i < k; i++) printf (" "); X for (i = 0; i < l; i++) printf " "; X if ($2 != "") printf " %s", $2; X if ($3 != "") printf " %s", $3; X if ($4 != "") printf " %s", $4; X if ($5 != "") printf " %s", $5; X if ($6 != "") printf " %s", $6; X print ""; X} END_OF_FILE if test 423 -ne `wc -c <'.awk'`; then echo shar: \"'.awk'\" unpacked with wrong size! fi # end of '.awk' fi if test -f '.grep' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'.grep'\" else echo shar: Extracting \"'.grep'\" \(115 characters\) sed "s/^X//" >'.grep' <<'END_OF_FILE' X#!/bin/sh f="k" while [ "$f" != "" ]; do X read f X if [ "$f" != "" ]; then X grep -i "$f$" $1 | wc -l X fi done END_OF_FILE if test 115 -ne `wc -c <'.grep'`; then echo shar: \"'.grep'\" unpacked with wrong size! fi # end of '.grep' fi if test -f '.ignored' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'.ignored'\" else echo shar: Extracting \"'.ignored'\" \(25 characters\) sed "s/^X//" >'.ignored' <<'END_OF_FILE' root server bin sys uucp END_OF_FILE if test 25 -ne `wc -c <'.ignored'`; then echo shar: \"'.ignored'\" unpacked with wrong size! fi # end of '.ignored' fi if test -f '.stats' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'.stats'\" else echo shar: Extracting \"'.stats'\" \(470 characters\) sed "s/^X//" >'.stats' <<'END_OF_FILE' X#!/bin/sh pth=$1 subscribers=$2 headers=$3 outfile=$4 shift; shift; shift; shift if [ $# = 0 ]; then X if [ `cut -d" " -f1 $subscribers > emails` ]; then X exit 1 X fi else X for user X do X echo $user >> emails X done fi if [ `cat emails | $pth/.grep $headers > counts` ]; then X exit 1 fi if [ `paste emails counts | awk -f $pth/.awk - >> $outfile` ]; then X exit 1 fi echo Total number of messages on file: `cat $headers | wc -l` >> $outfile rm counts rm emails END_OF_FILE if test 470 -ne `wc -c <'.stats'`; then echo shar: \"'.stats'\" unpacked with wrong size! fi # end of '.stats' fi if test -f 'MANIFEST' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'MANIFEST'\" else echo shar: Extracting \"'MANIFEST'\" \(2445 characters\) sed "s/^X//" >'MANIFEST' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X .awk 1 X .grep 1 X .ignored 1 X .stats 1 X MANIFEST 1 X archives 1 X archives/listserv 1 X archives/listserv/DIR 1 X archives/listserv/INDEX 1 X archives/listserv/example.dat 1 X archives/listserv/example.dat/example.dat1 1 X archives/listserv/example.dat/example.dat2 1 X archives/listserv/example.dat/example.dat3 1 X archives/listserv/info 1 X archives/listserv/refcard 1 X archives/pub 1 X archives/pub/DIR 1 X archives/pub/INDEX 1 X archives/pub/info 1 X archives/pub/unix 1 X archives/pub/unix/DIR 1 X archives/pub/unix/INDEX 1 X archives/pub/unix/info 1 X config 1 X doc 1 X doc/README 1 X doc/farch.nr 1 X doc/queue.nr 1 X doc/server.nr 5 X flocks 1 X help 1 X help/general 1 X help/get 1 X help/index 1 X help/information 1 X help/lists 1 X help/recipients 1 X help/release 1 X help/set 1 X help/statistics 1 X help/subscribe 1 X help/unsubscribe 1 X news 1 X peer 1 X queued 1 X redux 1 X reformat 1 X setup 1 X src 1 X src/Makefile 1 X src/README 2 X src/REGISTRATION 1 X src/defs.h 2 X src/farch.c 3 X src/global.h 1 X src/list.c 4 X src/list.h 1 X src/listserv.c 6 X src/listserv.h 1 X src/misc.c 3 X src/pqueue.c 1 X src/pqueue.h 1 X src/sender.c 2 X src/serverd.c 2 X src/serverd.h 1 X src/signals.c 1 X src/start.c 2 X src/start.h 1 X src/struct.h 1 X src/sysmail.c 2 X src/sysmail.h 2 X src/tlock.c 1 X stds 1 X ulock 1 END_OF_FILE if test 2445 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test ! -d 'archives' ; then echo shar: Creating directory \"'archives'\" mkdir 'archives' fi if test ! -d 'archives/listserv' ; then echo shar: Creating directory \"'archives/listserv'\" mkdir 'archives/listserv' fi if test -f 'archives/listserv/DIR' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/DIR'\" else echo shar: Extracting \"'archives/listserv/DIR'\" \(236 characters\) sed "s/^X//" >'archives/listserv/DIR' <<'END_OF_FILE' info 1 /usr/server/archives/listserv Info about the master archive refcard 1 /usr/server/archives/listserv List of available requests example.dat 3 /usr/server/archives/listserv/example.dat Example file hosts 1 /etc System's hosts file END_OF_FILE if test 236 -ne `wc -c <'archives/listserv/DIR'`; then echo shar: \"'archives/listserv/DIR'\" unpacked with wrong size! fi # end of 'archives/listserv/DIR' fi if test -f 'archives/listserv/INDEX' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/INDEX'\" else echo shar: Extracting \"'archives/listserv/INDEX'\" \(103 characters\) sed "s/^X//" >'archives/listserv/INDEX' <<'END_OF_FILE' LISTSERV /usr/server/archives/listserv pub /usr/server/archives/pub unix /usr/server/archives/pub/unix END_OF_FILE if test 103 -ne `wc -c <'archives/listserv/INDEX'`; then echo shar: \"'archives/listserv/INDEX'\" unpacked with wrong size! fi # end of 'archives/listserv/INDEX' fi if test ! -d 'archives/listserv/example.dat' ; then echo shar: Creating directory \"'archives/listserv/example.dat'\" mkdir 'archives/listserv/example.dat' fi if test -f 'archives/listserv/example.dat/example.dat1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/example.dat/example.dat1'\" else echo shar: Extracting \"'archives/listserv/example.dat/example.dat1'\" \(27 characters\) sed "s/^X//" >'archives/listserv/example.dat/example.dat1' <<'END_OF_FILE' Part 1 of file EXAMPLE.DAT END_OF_FILE if test 27 -ne `wc -c <'archives/listserv/example.dat/example.dat1'`; then echo shar: \"'archives/listserv/example.dat/example.dat1'\" unpacked with wrong size! fi # end of 'archives/listserv/example.dat/example.dat1' fi if test -f 'archives/listserv/example.dat/example.dat2' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/example.dat/example.dat2'\" else echo shar: Extracting \"'archives/listserv/example.dat/example.dat2'\" \(27 characters\) sed "s/^X//" >'archives/listserv/example.dat/example.dat2' <<'END_OF_FILE' Part 2 of file EXAMPLE.DAT END_OF_FILE if test 27 -ne `wc -c <'archives/listserv/example.dat/example.dat2'`; then echo shar: \"'archives/listserv/example.dat/example.dat2'\" unpacked with wrong size! fi # end of 'archives/listserv/example.dat/example.dat2' fi if test -f 'archives/listserv/example.dat/example.dat3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/example.dat/example.dat3'\" else echo shar: Extracting \"'archives/listserv/example.dat/example.dat3'\" \(27 characters\) sed "s/^X//" >'archives/listserv/example.dat/example.dat3' <<'END_OF_FILE' Part 3 of file EXAMPLE.DAT END_OF_FILE if test 27 -ne `wc -c <'archives/listserv/example.dat/example.dat3'`; then echo shar: \"'archives/listserv/example.dat/example.dat3'\" unpacked with wrong size! fi # end of 'archives/listserv/example.dat/example.dat3' fi if test -f 'archives/listserv/info' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/info'\" else echo shar: Extracting \"'archives/listserv/info'\" \(50 characters\) sed "s/^X//" >'archives/listserv/info' <<'END_OF_FILE' Place to put information for the LISTSERV archive END_OF_FILE if test 50 -ne `wc -c <'archives/listserv/info'`; then echo shar: \"'archives/listserv/info'\" unpacked with wrong size! fi # end of 'archives/listserv/info' fi if test -f 'archives/listserv/refcard' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'archives/listserv/refcard'\" else echo shar: Extracting \"'archives/listserv/refcard'\" \(289 characters\) sed "s/^X//" >'archives/listserv/refcard' <<'END_OF_FILE' Recognized commands are: X help [command] set [