ftp.nice.ch/pub/next/unix/mail/smail3.1.20.s.tar.gz#/smail3.1.20/samples/bsmtp/cbsmtp.sh

This is cbsmtp.sh in view mode; [Download] [Up]

#!/bin/sh
# @(#)samples/bsmtp/cbsmtp.sh	1.2 24 Oct 1990 05:21:04

# deliver messages accumlated into subdirectories of the
# outq spool directory.  Subdirectory names are based on
# the actual hostnames involved:

OUTQ=/usr/spool/smail/outq
UUX=/usr/bin/uux
LOCALHOST=busboy.uts.amdahl.com
COMPRESS=/usr/local/bin/compress

cd $OUTQ
# loop through all of the subdirectories
for i in *; do (
	cd $i
	list=q*		# get the list of message files
	if [ "$list" = "*" ]; then
		# no messages were found
		exit 0	# leave sub-shell
	fi
	# compress all of the files, adding HELO and QUIT commands
	(echo "HELO $LOCALHOST"
	 cat $list
	 echo QUIT) | $COMPRESS | $UUX - $i!rsmtp
	rm $list
); done

exit 0

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.