[comp.unix.xenix] Smail under Xenix System V: a fix for Micnet users

chip@ateng.UUCP (Chip Salzenberg) (12/18/87)

On December 1, I posted modifications to the smail program for use with
SCO Xenix System V.  Several people have installed these modifications and
are now running smail without trouble.  (If you have installed my smail
mods, please send me a short note; I want to build a mailing list.)

However -- Allen Gwinn (allen@sulaco) has reported a problem using
smail with my changes on a Micnet network.  Specifically, Micnet can be
configured so that all UUCP traffic is automatically forwarded to a
`gateway' machine.  When Allen installed smail, this automatic forwarding
broke down because execmail, which handles the forwarding, wasn't being used
for remote mail.  Instead, smail was calling uux directly.

(Pocket editorial:  I personally think that Micnet is a loss.  Here at A T
Engineering, we have two in-house Xenix machines, and we talk with UUCP.
It's much simpler to administer than a mixed network. -- But I digress.)

What follows is a patch to deliver.c.  This patch has the following effect:
In a system with execmail, smail will give _all_ mail, regardless of
destination, to the local mailer (execmail.x).  Since execmail handles
Micnet forwarding, the world becomes sane again.  (Well, almost.  :-))

(This article is suitable for feeding directly to Larry Wall's `patch' program.
If you don't have patch, get it -- it's the best thing since `diff'.)

(Oh, by the way:  I can't be responsible for the effects of installing this
patch.  Void where prohibited.  Not the Beatles.)

Index: deliver.c
*** smail_prev/deliver.c	Tue Dec  1 14:52:01 1987
--- smail/deliver.c	Fri Dec 18 09:52:41 1987
***************
*** 223,229
  
  		if (retrying) {
  			command = scommand;
! 		} else if (form == LOCAL) {
  			command = lcommand;
  		} else {
  			command = rcommand;
--- 223,237 -----
  
  		if (retrying) {
  			command = scommand;
! 		} else {
! #if defined(EXECMAIL)
! 			/*
! 			 * If we are in a Xenix system with execmail,
! 			 * let execmail handle all messages (except
! 			 * retries).  If we were to call uux directly,
! 			 * then automatic forwarding of all UUCP traffic
! 			 * to a single Micnet gateway wouldn't work.
! 			 */
  			command = lcommand;
  #else
  			/*
***************
*** 225,235
  			command = scommand;
  		} else if (form == LOCAL) {
  			command = lcommand;
! 		} else {
! 			command = rcommand;
! 			if(flags == uux_noqueue) {
! 				noqcnt++;
! 			}
  		}
  		ADVISE("COMMAND: %s\n", command);
  
--- 233,252 -----
  			 * to a single Micnet gateway wouldn't work.
  			 */
  			command = lcommand;
! #else
! 			/*
! 			 * In a system without execmail, give the message
! 			 * to either the local mailer or uux.
! 			 */
! 			if (form == LOCAL) {
! 				command = lcommand;
! 			} else {
! 				command = rcommand;
! 				if(flags == uux_noqueue) {
! 					noqcnt++;
! 				}
! 			}
! #endif
  		}
  		ADVISE("COMMAND: %s\n", command);
  
[End of patch]
-- 
Chip Salzenberg         "chip@ateng.UUCP"  or  "{codas,uunet}!ateng!chip"
A T Engineering         My employer's opinions are not mine, but these are.
 "Gentlemen, your work today has been outstanding, and I intend to recommend
    you all for promotion -- in whatever fleet we end up serving."   - JTK