🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.sys.next
1 messages
1 total messages Started by Carsten Lutz Sun, 20 Dec 1992 13:23
uucleanup
#416
Author: Carsten Lutz
Date: Sun, 20 Dec 1992 13:23
92 lines
2959 bytes
Moin !

Falls hier ueberhaupt noch jemand das NeXT-UUCP benutzt, interessiert ihn
vielleicht folgendes:

Mich nervte es etwas, dass bei Benutzung des NeXT-uuclean der Absender einer
Mail nicht informiert wird, wenn diese geloescht wird. Daher habe ich mir
einen uucleanup gebastelt, der alle Mails, die laenger als n Tage auf dem
System rumlagen loescht und dem Absender eine Nachricht zukommen laesst.
( Also _zusaetzlich_ zum uuclean zu benutzen ) Ich weiss, dass es schon
haufenweise solche Skripte gibt, aber ich wollte mal wieder ein wenig
Shellprogrammierung ueben und vielleicht kann's ja jemand gebrauchen:

#! /bin/sh
#
# uucleanup for NeXT-UUCP
# (c) 19.12.1992 by Carsten Lutz
# clu@malihh.hanse.de
#

# user-configurable section ( policy )

DAYS=14
INCLLINES=100
POSTMASTER=postmaster

# user-configurable section ( compatibility )

DOMAINNAME=`hostname``domainname`
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin

CDIR=/usr/spool/uucp/C.
DDIR=/usr/spool/uucp/D.`hostname`
XDIR=/usr/spool/uucp/D.`hostname`X

# end of user-configurable section

for CFILE in `find ${CDIR} -ctime +${DAYS} -print`; do
  if [ -s ${CFILE} ]; then
    set `tail -1 ${CFILE}`
    XFILE=${XDIR}/$6

    if [ -s ${XFILE} ]; then
      CLINE=`grep "^C.*rmail" ${XFILE}`

      if [ $? -eq 0 ]; then
	set `head -1 ${CFILE}`
	DFILE=${DDIR}/$6

	set $CLINE
	shift
	COMMAND=$*
		
	SITE=`echo $CFILE | sed -e "sY.*/C\.YYg;s/[A-Z].*//g"`

	SLINE=`grep "^From: " ${DFILE}`
	if [ $? -eq 0 ]; then
	  # This nice thingy is stolen from CNews' newsreply-script
	  SENDER=` echo ${SLINE} | sed 's/^[^:]*:[	 ]*//
				s/[	 ]*(.*)//
				s/^.*<\(.*\)>.*$/\1/
				1q' `
	else
	  SENDER=$POSTMASTER
	fi

	( echo "   ----- Error description follows -----"
	  echo "Couldn't connect to site "${SITE}" for "${DAYS}" days."
	  echo "Couldn't process command '"${COMMAND}"'."
	  set $SENDER
	  if [ $1 = ${POSTMASTER} ]; then
	    echo "Couldn't determine sender."
	  fi
	  echo ""
	  echo "   ----- Unsent message follows ( "${INCLLINES}" lines ) -----"
	  head -100 $DFILE
	) | Mail -s "Subject: Returned mail: Couldn't reach site" \
				${POSTMASTER},$SENDER
	rm -f ${CFILE} ${XFILE} {$DFILE}
      fi
    fi
  fi
done





-- 
* Carsten Lutz, Rellingen, FRG / clu@malihh.hanse.de ( NeXTmail accepted )  *
*   Voice : +49 4101 512493  Fax: +49 4101 27757  Traily : +49 4101 22306   *
* Deine Schluepfer, meine Seele - auf beiden eine Spur von Scheisse ( Buk ) *
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads