Uucp and rejected mail

Henry Spencer henry at utzoo.UUCP
Tue Oct 16 03:14:39 AEST 1984


> Even if smart mailers as sendmail in 4.2 can handle mail failures,
> sites should forward (easily done in 4.2BSD) all mail to uucp, news,
> notes, usenet, postmaster, ...  to some responsible system administrator.

I assume you mean "all failing mail".  The above is actually dead easy
to do in *any* Unix.  "rmail" here is a shell file, not just a link to
mail; here's what it looks like:

	: '@(#)rmail	1.4 of 24 Sept 84'
	PATH=/bin:/usr/bin ; export PATH
	tee /tmp/rm$$ | mail -R $* >/tmp/rmm$$ 2>&1
	if test -s /tmp/rmm$$
	then
		( echo rmail $* ; cat /tmp/rmm$$ ; \
			echo ----- ; cat /tmp/rm$$ ; echo ----- ) | mail uucp
	fi
	rm -f /tmp/rm$$ /tmp/rmm$$

In other words, if anything goes wrong, mail the complaints and the message
to "uucp" so it can be handled.  The "-R" option to mail is a local addition,
to get around the ugly business of having mail's behavior depend on what
name is used to invoke it.  If you don't have source, link /bin/mail to
/bin/realrmail and change "mail -R" to "realrmail"; we ran that way for
quite a while.

Something like this really should be standard equipment for *any* site
that doesn't have something like sendmail.  It's simple and works well.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.unix.wizards mailing list