xref: /csrg-svn/usr.sbin/sendmail/src/readcf.c (revision 36497)
1 /*
2  * Copyright (c) 1983 Eric P. Allman
3  * Copyright (c) 1988 Regents of the University of California.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted
7  * provided that the above copyright notice and this paragraph are
8  * duplicated in all such forms and that any documentation,
9  * advertising materials, and other materials related to such
10  * distribution and use acknowledge that the software was developed
11  * by the University of California, Berkeley.  The name of the
12  * University may not be used to endorse or promote products derived
13  * from this software without specific prior written permission.
14  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  */
18 
19 #ifndef lint
20 static char sccsid[] = "@(#)readcf.c	5.17 (Berkeley) 01/01/89";
21 #endif /* not lint */
22 
23 # include "sendmail.h"
24 
25 /*
26 **  READCF -- read control file.
27 **
28 **	This routine reads the control file and builds the internal
29 **	form.
30 **
31 **	The file is formatted as a sequence of lines, each taken
32 **	atomically.  The first character of each line describes how
33 **	the line is to be interpreted.  The lines are:
34 **		Dxval		Define macro x to have value val.
35 **		Cxword		Put word into class x.
36 **		Fxfile [fmt]	Read file for lines to put into
37 **				class x.  Use scanf string 'fmt'
38 **				or "%s" if not present.  Fmt should
39 **				only produce one string-valued result.
40 **		Hname: value	Define header with field-name 'name'
41 **				and value as specified; this will be
42 **				macro expanded immediately before
43 **				use.
44 **		Sn		Use rewriting set n.
45 **		Rlhs rhs	Rewrite addresses that match lhs to
46 **				be rhs.
47 **		Mn arg=val...	Define mailer.  n is the internal name.
48 **				Args specify mailer parameters.
49 **		Oxvalue		Set option x to value.
50 **		Pname=value	Set precedence name to value.
51 **
52 **	Parameters:
53 **		cfname -- control file name.
54 **
55 **	Returns:
56 **		none.
57 **
58 **	Side Effects:
59 **		Builds several internal tables.
60 */
61 
62 readcf(cfname)
63 	char *cfname;
64 {
65 	FILE *cf;
66 	int ruleset = 0;
67 	char *q;
68 	char **pv;
69 	struct rewrite *rwp = NULL;
70 	char buf[MAXLINE];
71 	register char *p;
72 	extern char **prescan();
73 	extern char **copyplist();
74 	char exbuf[MAXLINE];
75 	char pvpbuf[PSBUFSIZE];
76 	extern char *fgetfolded();
77 	extern char *munchstring();
78 
79 	cf = fopen(cfname, "r");
80 	if (cf == NULL)
81 	{
82 		syserr("cannot open %s", cfname);
83 		exit(EX_OSFILE);
84 	}
85 
86 	FileName = cfname;
87 	LineNumber = 0;
88 	while (fgetfolded(buf, sizeof buf, cf) != NULL)
89 	{
90 		/* map $ into \001 (ASCII SOH) for macro expansion */
91 		for (p = buf; *p != '\0'; p++)
92 		{
93 			if (*p != '$')
94 				continue;
95 
96 			if (p[1] == '$')
97 			{
98 				/* actual dollar sign.... */
99 				(void) strcpy(p, p + 1);
100 				continue;
101 			}
102 
103 			/* convert to macro expansion character */
104 			*p = '\001';
105 		}
106 
107 		/* interpret this line */
108 		switch (buf[0])
109 		{
110 		  case '\0':
111 		  case '#':		/* comment */
112 			break;
113 
114 		  case 'R':		/* rewriting rule */
115 			for (p = &buf[1]; *p != '\0' && *p != '\t'; p++)
116 				continue;
117 
118 			if (*p == '\0')
119 			{
120 				syserr("invalid rewrite line \"%s\"", buf);
121 				break;
122 			}
123 
124 			/* allocate space for the rule header */
125 			if (rwp == NULL)
126 			{
127 				RewriteRules[ruleset] = rwp =
128 					(struct rewrite *) xalloc(sizeof *rwp);
129 			}
130 			else
131 			{
132 				rwp->r_next = (struct rewrite *) xalloc(sizeof *rwp);
133 				rwp = rwp->r_next;
134 			}
135 			rwp->r_next = NULL;
136 
137 			/* expand and save the LHS */
138 			*p = '\0';
139 			expand(&buf[1], exbuf, &exbuf[sizeof exbuf], CurEnv);
140 			rwp->r_lhs = prescan(exbuf, '\t', pvpbuf);
141 			if (rwp->r_lhs != NULL)
142 				rwp->r_lhs = copyplist(rwp->r_lhs, TRUE);
143 
144 			/* expand and save the RHS */
145 			while (*++p == '\t')
146 				continue;
147 			q = p;
148 			while (*p != '\0' && *p != '\t')
149 				p++;
150 			*p = '\0';
151 			expand(q, exbuf, &exbuf[sizeof exbuf], CurEnv);
152 			rwp->r_rhs = prescan(exbuf, '\t', pvpbuf);
153 			if (rwp->r_rhs != NULL)
154 				rwp->r_rhs = copyplist(rwp->r_rhs, TRUE);
155 			break;
156 
157 		  case 'S':		/* select rewriting set */
158 			ruleset = atoi(&buf[1]);
159 			if (ruleset >= MAXRWSETS || ruleset < 0)
160 			{
161 				syserr("bad ruleset %d (%d max)", ruleset, MAXRWSETS);
162 				ruleset = 0;
163 			}
164 			rwp = NULL;
165 			break;
166 
167 		  case 'D':		/* macro definition */
168 			define(buf[1], newstr(munchstring(&buf[2])), CurEnv);
169 			break;
170 
171 		  case 'H':		/* required header line */
172 			(void) chompheader(&buf[1], TRUE);
173 			break;
174 
175 		  case 'C':		/* word class */
176 		  case 'F':		/* word class from file */
177 			/* read list of words from argument or file */
178 			if (buf[0] == 'F')
179 			{
180 				/* read from file */
181 				for (p = &buf[2]; *p != '\0' && !isspace(*p); p++)
182 					continue;
183 				if (*p == '\0')
184 					p = "%s";
185 				else
186 				{
187 					*p = '\0';
188 					while (isspace(*++p))
189 						continue;
190 				}
191 				fileclass(buf[1], &buf[2], p);
192 				break;
193 			}
194 
195 			/* scan the list of words and set class for all */
196 			for (p = &buf[2]; *p != '\0'; )
197 			{
198 				register char *wd;
199 				char delim;
200 
201 				while (*p != '\0' && isspace(*p))
202 					p++;
203 				wd = p;
204 				while (*p != '\0' && !isspace(*p))
205 					p++;
206 				delim = *p;
207 				*p = '\0';
208 				if (wd[0] != '\0')
209 					setclass(buf[1], wd);
210 				*p = delim;
211 			}
212 			break;
213 
214 		  case 'M':		/* define mailer */
215 			makemailer(&buf[1]);
216 			break;
217 
218 		  case 'O':		/* set option */
219 			setoption(buf[1], &buf[2], TRUE, FALSE);
220 			break;
221 
222 		  case 'P':		/* set precedence */
223 			if (NumPriorities >= MAXPRIORITIES)
224 			{
225 				toomany('P', MAXPRIORITIES);
226 				break;
227 			}
228 			for (p = &buf[1]; *p != '\0' && *p != '=' && *p != '\t'; p++)
229 				continue;
230 			if (*p == '\0')
231 				goto badline;
232 			*p = '\0';
233 			Priorities[NumPriorities].pri_name = newstr(&buf[1]);
234 			Priorities[NumPriorities].pri_val = atoi(++p);
235 			NumPriorities++;
236 			break;
237 
238 		  case 'T':		/* trusted user(s) */
239 			p = &buf[1];
240 			while (*p != '\0')
241 			{
242 				while (isspace(*p))
243 					p++;
244 				q = p;
245 				while (*p != '\0' && !isspace(*p))
246 					p++;
247 				if (*p != '\0')
248 					*p++ = '\0';
249 				if (*q == '\0')
250 					continue;
251 				for (pv = TrustedUsers; *pv != NULL; pv++)
252 					continue;
253 				if (pv >= &TrustedUsers[MAXTRUST])
254 				{
255 					toomany('T', MAXTRUST);
256 					break;
257 				}
258 				*pv = newstr(q);
259 			}
260 			break;
261 
262 		  default:
263 		  badline:
264 			syserr("unknown control line \"%s\"", buf);
265 		}
266 	}
267 	FileName = NULL;
268 }
269 /*
270 **  TOOMANY -- signal too many of some option
271 **
272 **	Parameters:
273 **		id -- the id of the error line
274 **		maxcnt -- the maximum possible values
275 **
276 **	Returns:
277 **		none.
278 **
279 **	Side Effects:
280 **		gives a syserr.
281 */
282 
283 toomany(id, maxcnt)
284 	char id;
285 	int maxcnt;
286 {
287 	syserr("too many %c lines, %d max", id, maxcnt);
288 }
289 /*
290 **  FILECLASS -- read members of a class from a file
291 **
292 **	Parameters:
293 **		class -- class to define.
294 **		filename -- name of file to read.
295 **		fmt -- scanf string to use for match.
296 **
297 **	Returns:
298 **		none
299 **
300 **	Side Effects:
301 **
302 **		puts all lines in filename that match a scanf into
303 **			the named class.
304 */
305 
306 fileclass(class, filename, fmt)
307 	int class;
308 	char *filename;
309 	char *fmt;
310 {
311 	FILE *f;
312 	char buf[MAXLINE];
313 
314 	f = fopen(filename, "r");
315 	if (f == NULL)
316 	{
317 		syserr("cannot open %s", filename);
318 		return;
319 	}
320 
321 	while (fgets(buf, sizeof buf, f) != NULL)
322 	{
323 		register STAB *s;
324 		register char *p;
325 # ifdef SCANF
326 		char wordbuf[MAXNAME+1];
327 
328 		if (sscanf(buf, fmt, wordbuf) != 1)
329 			continue;
330 		p = wordbuf;
331 # else SCANF
332 		p = buf;
333 # endif SCANF
334 
335 		/*
336 		**  Break up the match into words.
337 		*/
338 
339 		while (*p != '\0')
340 		{
341 			register char *q;
342 
343 			/* strip leading spaces */
344 			while (isspace(*p))
345 				p++;
346 			if (*p == '\0')
347 				break;
348 
349 			/* find the end of the word */
350 			q = p;
351 			while (*p != '\0' && !isspace(*p))
352 				p++;
353 			if (*p != '\0')
354 				*p++ = '\0';
355 
356 			/* enter the word in the symbol table */
357 			s = stab(q, ST_CLASS, ST_ENTER);
358 			setbitn(class, s->s_class);
359 		}
360 	}
361 
362 	(void) fclose(f);
363 }
364 /*
365 **  MAKEMAILER -- define a new mailer.
366 **
367 **	Parameters:
368 **		line -- description of mailer.  This is in labeled
369 **			fields.  The fields are:
370 **			   P -- the path to the mailer
371 **			   F -- the flags associated with the mailer
372 **			   A -- the argv for this mailer
373 **			   S -- the sender rewriting set
374 **			   R -- the recipient rewriting set
375 **			   E -- the eol string
376 **			The first word is the canonical name of the mailer.
377 **
378 **	Returns:
379 **		none.
380 **
381 **	Side Effects:
382 **		enters the mailer into the mailer table.
383 */
384 
385 makemailer(line)
386 	char *line;
387 {
388 	register char *p;
389 	register struct mailer *m;
390 	register STAB *s;
391 	int i;
392 	char fcode;
393 	extern int NextMailer;
394 	extern char **makeargv();
395 	extern char *munchstring();
396 	extern char *DelimChar;
397 	extern long atol();
398 
399 	/* allocate a mailer and set up defaults */
400 	m = (struct mailer *) xalloc(sizeof *m);
401 	bzero((char *) m, sizeof *m);
402 	m->m_mno = NextMailer;
403 	m->m_eol = "\n";
404 
405 	/* collect the mailer name */
406 	for (p = line; *p != '\0' && *p != ',' && !isspace(*p); p++)
407 		continue;
408 	if (*p != '\0')
409 		*p++ = '\0';
410 	m->m_name = newstr(line);
411 
412 	/* now scan through and assign info from the fields */
413 	while (*p != '\0')
414 	{
415 		while (*p != '\0' && (*p == ',' || isspace(*p)))
416 			p++;
417 
418 		/* p now points to field code */
419 		fcode = *p;
420 		while (*p != '\0' && *p != '=' && *p != ',')
421 			p++;
422 		if (*p++ != '=')
423 		{
424 			syserr("`=' expected");
425 			return;
426 		}
427 		while (isspace(*p))
428 			p++;
429 
430 		/* p now points to the field body */
431 		p = munchstring(p);
432 
433 		/* install the field into the mailer struct */
434 		switch (fcode)
435 		{
436 		  case 'P':		/* pathname */
437 			m->m_mailer = newstr(p);
438 			break;
439 
440 		  case 'F':		/* flags */
441 			for (; *p != '\0'; p++)
442 				setbitn(*p, m->m_flags);
443 			break;
444 
445 		  case 'S':		/* sender rewriting ruleset */
446 		  case 'R':		/* recipient rewriting ruleset */
447 			i = atoi(p);
448 			if (i < 0 || i >= MAXRWSETS)
449 			{
450 				syserr("invalid rewrite set, %d max", MAXRWSETS);
451 				return;
452 			}
453 			if (fcode == 'S')
454 				m->m_s_rwset = i;
455 			else
456 				m->m_r_rwset = i;
457 			break;
458 
459 		  case 'E':		/* end of line string */
460 			m->m_eol = newstr(p);
461 			break;
462 
463 		  case 'A':		/* argument vector */
464 			m->m_argv = makeargv(p);
465 			break;
466 
467 		  case 'M':		/* maximum message size */
468 			m->m_maxsize = atol(p);
469 			break;
470 		}
471 
472 		p = DelimChar;
473 	}
474 
475 	/* now store the mailer away */
476 	if (NextMailer >= MAXMAILERS)
477 	{
478 		syserr("too many mailers defined (%d max)", MAXMAILERS);
479 		return;
480 	}
481 	Mailer[NextMailer++] = m;
482 	s = stab(m->m_name, ST_MAILER, ST_ENTER);
483 	s->s_mailer = m;
484 }
485 /*
486 **  MUNCHSTRING -- translate a string into internal form.
487 **
488 **	Parameters:
489 **		p -- the string to munch.
490 **
491 **	Returns:
492 **		the munched string.
493 **
494 **	Side Effects:
495 **		Sets "DelimChar" to point to the string that caused us
496 **		to stop.
497 */
498 
499 char *
500 munchstring(p)
501 	register char *p;
502 {
503 	register char *q;
504 	bool backslash = FALSE;
505 	bool quotemode = FALSE;
506 	static char buf[MAXLINE];
507 	extern char *DelimChar;
508 
509 	for (q = buf; *p != '\0'; p++)
510 	{
511 		if (backslash)
512 		{
513 			/* everything is roughly literal */
514 			backslash = FALSE;
515 			switch (*p)
516 			{
517 			  case 'r':		/* carriage return */
518 				*q++ = '\r';
519 				continue;
520 
521 			  case 'n':		/* newline */
522 				*q++ = '\n';
523 				continue;
524 
525 			  case 'f':		/* form feed */
526 				*q++ = '\f';
527 				continue;
528 
529 			  case 'b':		/* backspace */
530 				*q++ = '\b';
531 				continue;
532 			}
533 			*q++ = *p;
534 		}
535 		else
536 		{
537 			if (*p == '\\')
538 				backslash = TRUE;
539 			else if (*p == '"')
540 				quotemode = !quotemode;
541 			else if (quotemode || *p != ',')
542 				*q++ = *p;
543 			else
544 				break;
545 		}
546 	}
547 
548 	DelimChar = p;
549 	*q++ = '\0';
550 	return (buf);
551 }
552 /*
553 **  MAKEARGV -- break up a string into words
554 **
555 **	Parameters:
556 **		p -- the string to break up.
557 **
558 **	Returns:
559 **		a char **argv (dynamically allocated)
560 **
561 **	Side Effects:
562 **		munges p.
563 */
564 
565 char **
566 makeargv(p)
567 	register char *p;
568 {
569 	char *q;
570 	int i;
571 	char **avp;
572 	char *argv[MAXPV + 1];
573 
574 	/* take apart the words */
575 	i = 0;
576 	while (*p != '\0' && i < MAXPV)
577 	{
578 		q = p;
579 		while (*p != '\0' && !isspace(*p))
580 			p++;
581 		while (isspace(*p))
582 			*p++ = '\0';
583 		argv[i++] = newstr(q);
584 	}
585 	argv[i++] = NULL;
586 
587 	/* now make a copy of the argv */
588 	avp = (char **) xalloc(sizeof *avp * i);
589 	bcopy((char *) argv, (char *) avp, sizeof *avp * i);
590 
591 	return (avp);
592 }
593 /*
594 **  PRINTRULES -- print rewrite rules (for debugging)
595 **
596 **	Parameters:
597 **		none.
598 **
599 **	Returns:
600 **		none.
601 **
602 **	Side Effects:
603 **		prints rewrite rules.
604 */
605 
606 printrules()
607 {
608 	register struct rewrite *rwp;
609 	register int ruleset;
610 
611 	for (ruleset = 0; ruleset < 10; ruleset++)
612 	{
613 		if (RewriteRules[ruleset] == NULL)
614 			continue;
615 		printf("\n----Rule Set %d:", ruleset);
616 
617 		for (rwp = RewriteRules[ruleset]; rwp != NULL; rwp = rwp->r_next)
618 		{
619 			printf("\nLHS:");
620 			printav(rwp->r_lhs);
621 			printf("RHS:");
622 			printav(rwp->r_rhs);
623 		}
624 	}
625 }
626 
627 /*
628 **  SETOPTION -- set global processing option
629 **
630 **	Parameters:
631 **		opt -- option name.
632 **		val -- option value (as a text string).
633 **		safe -- set if this came from a configuration file.
634 **			Some options (if set from the command line) will
635 **			reset the user id to avoid security problems.
636 **		sticky -- if set, don't let other setoptions override
637 **			this value.
638 **
639 **	Returns:
640 **		none.
641 **
642 **	Side Effects:
643 **		Sets options as implied by the arguments.
644 */
645 
646 static BITMAP	StickyOpt;		/* set if option is stuck */
647 extern char	*NetName;		/* name of home (local) network */
648 
649 setoption(opt, val, safe, sticky)
650 	char opt;
651 	char *val;
652 	bool safe;
653 	bool sticky;
654 {
655 	extern bool atobool();
656 	extern time_t convtime();
657 	extern int QueueLA;
658 	extern int RefuseLA;
659 	extern bool trusteduser();
660 	extern char *username();
661 
662 	if (tTd(37, 1))
663 		printf("setoption %c=%s", opt, val);
664 
665 	/*
666 	**  See if this option is preset for us.
667 	*/
668 
669 	if (bitnset(opt, StickyOpt))
670 	{
671 		if (tTd(37, 1))
672 			printf(" (ignored)\n");
673 		return;
674 	}
675 
676 	/*
677 	**  Check to see if this option can be specified by this user.
678 	*/
679 
680 	if (!safe && getuid() == 0)
681 		safe = TRUE;
682 	if (!safe && index("deiLmorsv", opt) == NULL)
683 	{
684 		if (tTd(37, 1))
685 			printf(" (unsafe)");
686 		if (getuid() != geteuid())
687 		{
688 			printf("(Resetting uid)\n");
689 			(void) setgid(getgid());
690 			(void) setuid(getuid());
691 		}
692 	}
693 	else if (tTd(37, 1))
694 		printf("\n");
695 
696 	switch (opt)
697 	{
698 	  case 'A':		/* set default alias file */
699 		if (val[0] == '\0')
700 			AliasFile = "aliases";
701 		else
702 			AliasFile = newstr(val);
703 		break;
704 
705 	  case 'a':		/* look N minutes for "@:@" in alias file */
706 		if (val[0] == '\0')
707 			SafeAlias = 5;
708 		else
709 			SafeAlias = atoi(val);
710 		break;
711 
712 	  case 'B':		/* substitution for blank character */
713 		SpaceSub = val[0];
714 		if (SpaceSub == '\0')
715 			SpaceSub = ' ';
716 		break;
717 
718 	  case 'c':		/* don't connect to "expensive" mailers */
719 		NoConnect = atobool(val);
720 		break;
721 
722 	  case 'C':		/* checkpoint after N connections */
723 		CheckPointLimit = atoi(val);
724 		break;
725 
726 	  case 'd':		/* delivery mode */
727 		switch (*val)
728 		{
729 		  case '\0':
730 			SendMode = SM_DELIVER;
731 			break;
732 
733 		  case SM_QUEUE:	/* queue only */
734 #ifndef QUEUE
735 			syserr("need QUEUE to set -odqueue");
736 #endif QUEUE
737 			/* fall through..... */
738 
739 		  case SM_DELIVER:	/* do everything */
740 		  case SM_FORK:		/* fork after verification */
741 			SendMode = *val;
742 			break;
743 
744 		  default:
745 			syserr("Unknown delivery mode %c", *val);
746 			exit(EX_USAGE);
747 		}
748 		break;
749 
750 	  case 'D':		/* rebuild alias database as needed */
751 		AutoRebuild = atobool(val);
752 		break;
753 
754 	  case 'e':		/* set error processing mode */
755 		switch (*val)
756 		{
757 		  case EM_QUIET:	/* be silent about it */
758 		  case EM_MAIL:		/* mail back */
759 		  case EM_BERKNET:	/* do berknet error processing */
760 		  case EM_WRITE:	/* write back (or mail) */
761 			HoldErrs = TRUE;
762 			/* fall through... */
763 
764 		  case EM_PRINT:	/* print errors normally (default) */
765 			ErrorMode = *val;
766 			break;
767 		}
768 		break;
769 
770 	  case 'F':		/* file mode */
771 		FileMode = atooct(val) & 0777;
772 		break;
773 
774 	  case 'f':		/* save Unix-style From lines on front */
775 		SaveFrom = atobool(val);
776 		break;
777 
778 	  case 'g':		/* default gid */
779 		DefGid = atoi(val);
780 		break;
781 
782 	  case 'H':		/* help file */
783 		if (val[0] == '\0')
784 			HelpFile = "sendmail.hf";
785 		else
786 			HelpFile = newstr(val);
787 		break;
788 
789 	  case 'I':		/* use internet domain name server */
790 		UseNameServer = atobool(val);
791 		break;
792 
793 	  case 'i':		/* ignore dot lines in message */
794 		IgnrDot = atobool(val);
795 		break;
796 
797 	  case 'L':		/* log level */
798 		LogLevel = atoi(val);
799 		break;
800 
801 	  case 'M':		/* define macro */
802 		define(val[0], newstr(&val[1]), CurEnv);
803 		sticky = FALSE;
804 		break;
805 
806 	  case 'm':		/* send to me too */
807 		MeToo = atobool(val);
808 		break;
809 
810 	  case 'n':		/* validate RHS in newaliases */
811 		CheckAliases = atobool(val);
812 		break;
813 
814 # ifdef DAEMON
815 	  case 'N':		/* home (local?) network name */
816 		NetName = newstr(val);
817 		break;
818 # endif DAEMON
819 
820 	  case 'o':		/* assume old style headers */
821 		if (atobool(val))
822 			CurEnv->e_flags |= EF_OLDSTYLE;
823 		else
824 			CurEnv->e_flags &= ~EF_OLDSTYLE;
825 		break;
826 
827 	  case 'P':		/* postmaster copy address for returned mail */
828 		PostMasterCopy = newstr(val);
829 		break;
830 
831 	  case 'q':		/* slope of queue only function */
832 		QueueFactor = atoi(val);
833 		break;
834 
835 	  case 'Q':		/* queue directory */
836 		if (val[0] == '\0')
837 			QueueDir = "mqueue";
838 		else
839 			QueueDir = newstr(val);
840 		break;
841 
842 	  case 'r':		/* read timeout */
843 		ReadTimeout = convtime(val);
844 		break;
845 
846 	  case 'S':		/* status file */
847 		if (val[0] == '\0')
848 			StatFile = "sendmail.st";
849 		else
850 			StatFile = newstr(val);
851 		break;
852 
853 	  case 's':		/* be super safe, even if expensive */
854 		SuperSafe = atobool(val);
855 		break;
856 
857 	  case 'T':		/* queue timeout */
858 		TimeOut = convtime(val);
859 		/*FALLTHROUGH*/
860 
861 	  case 't':		/* time zone name */
862 		break;
863 
864 	  case 'u':		/* set default uid */
865 		DefUid = atoi(val);
866 		break;
867 
868 	  case 'v':		/* run in verbose mode */
869 		Verbose = atobool(val);
870 		break;
871 
872 	  case 'x':		/* load avg at which to auto-queue msgs */
873 		QueueLA = atoi(val);
874 		break;
875 
876 	  case 'X':		/* load avg at which to auto-reject connections */
877 		RefuseLA = atoi(val);
878 		break;
879 
880 	  case 'y':		/* work recipient factor */
881 		WkRecipFact = atoi(val);
882 		break;
883 
884 	  case 'Y':		/* fork jobs during queue runs */
885 		ForkQueueRuns = atobool(val);
886 		break;
887 
888 	  case 'z':		/* work message class factor */
889 		WkClassFact = atoi(val);
890 		break;
891 
892 	  case 'Z':		/* work time factor */
893 		WkTimeFact = atoi(val);
894 		break;
895 
896 	  default:
897 		break;
898 	}
899 	if (sticky)
900 		setbitn(opt, StickyOpt);
901 	return;
902 }
903 /*
904 **  SETCLASS -- set a word into a class
905 **
906 **	Parameters:
907 **		class -- the class to put the word in.
908 **		word -- the word to enter
909 **
910 **	Returns:
911 **		none.
912 **
913 **	Side Effects:
914 **		puts the word into the symbol table.
915 */
916 
917 setclass(class, word)
918 	int class;
919 	char *word;
920 {
921 	register STAB *s;
922 
923 	s = stab(word, ST_CLASS, ST_ENTER);
924 	setbitn(class, s->s_class);
925 }
926