[comp.mail.uucp] Smail 2.5 patch

jantypas@hope.UUCP (John Antypas) (04/28/88)

Smail Patch 
===== =====
The following patch below implement a limitted form of local delivery agents.
If smail can't route a domain, and it is found in a SPECIAL_DELIVERY file,
then the mail will be treated as local mail for lmail to deal with.  If it 
isn't found, then an error will occur like the old smail.

The special_delivery database contains lines of the following type:
# Comments
pattern\tpath
# Example for a local net (.net)
.net	/usr/local/localnetmail
# Packet radio
.aprn	/usr/local/ka9q

This would say that all mail with .net on it that can't be resolved is meant
for /usr/local/localnetmail to handle through lmail and .aprn goes to ka9q.
Lmail can retreive the information in the same way (by calling special_help())

special_help(char *address, *agent);

Given an address, scans database, if that address is found, reteurns the path
in agent or ERROR.  Function returns EX_OK on finding one, or EX_NOHOST.

----- Makefile.diff -----
11c11
< OBJECTS =	main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o
---
> OBJECTS =	main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o special.o
----- resolve.c.diff -----
63a64
> 	int special_help();
65a67
> 	char agent[SMLBUF];
67a70
> 
159c162,164
< **  be routed (rsvp( form ) == ROUTE), complain.
---
> **  be routed (rsvp( form ) == ROUTE), first see if we can have a local
> **  delivery agent handle the problem, (handled in local mailer)  if not
> **  then we can complain.
162,163c167,178
< 		exitstat = EX_NOHOST;
< 		ADVISE("resolve failed '%s' = '%s' @ '%s' (%s)\n",
---
> 		/* Check for special help */
> 		if (special_help(address, agent) == EX_OK)
> 		{
> 			/* Put full address into user */
> 			build( domain, user, form, temp );
> 			(void) strcpy( user, temp );
> 			(void) strcpy( domain, "" );
> 			form = LOCAL;
> 		} else
> 		{
> 			exitstat = EX_NOHOST;
> 			ADVISE("resolve failed '%s' = '%s' @ '%s' (%s)\n",
165c180,181
< 		form = ERROR;
---
> 			form = ERROR;
> 		}
----- defs.h.diff -----
106c106
< /*#define ALIAS	"/usr/lib/aliases"	/* location of mail aliases       */
---
> #define ALIAS	"/usr/lib/aliases"	/* location of mail aliases       */
143a144,145
> 
> #define SPECIAL_DELIVERY	"/usr/lib/specials"

John Antypas -- Soft21 --21st Century Software:
New Product from FastBuck Enterprises!  New Puzzle -- Rubik's Cling Wrap!
The puzzle you get stuck on! (Along with everything else ... almost)

UUCP: {garp, killer, pyramid, reed, sdcsvax!ucsd!ucrmath}!soft21!jantypas
Internet: jantypas%soft21.UUCP@{eddie.MIT.EDU, UCSD.EDU, uunet.UU.NET}