Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / conf / config / RCS / mts.c,v
1 head    2.20;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 2.20
9 date    94.03.23.23.35.23;      author jromine; state Exp;
10 branches;
11 next    2.19;
12
13 2.19
14 date    93.09.01.20.55.38;      author jromine; state Exp;
15 branches;
16 next    2.18;
17
18 2.18
19 date    93.08.19.23.36.12;      author jromine; state Exp;
20 branches;
21 next    2.17;
22
23 2.17
24 date    93.08.19.23.08.05;      author jromine; state Exp;
25 branches;
26 next    2.16;
27
28 2.16
29 date    92.11.24.18.40.34;      author jromine; state Exp;
30 branches;
31 next    2.15;
32
33 2.15
34 date    92.11.02.18.58.12;      author jromine; state Exp;
35 branches;
36 next    2.14;
37
38 2.14
39 date    92.05.19.20.51.57;      author jromine; state Exp;
40 branches;
41 next    2.13;
42
43 2.13
44 date    92.05.12.21.46.45;      author jromine; state Exp;
45 branches;
46 next    2.12;
47
48 2.12
49 date    92.02.10.18.12.35;      author jromine; state Exp;
50 branches;
51 next    2.11;
52
53 2.11
54 date    92.02.05.17.08.16;      author jromine; state Exp;
55 branches;
56 next    2.10;
57
58 2.10
59 date    92.02.03.17.49.13;      author jromine; state Exp;
60 branches;
61 next    2.9;
62
63 2.9
64 date    92.02.03.16.34.00;      author jromine; state Exp;
65 branches;
66 next    2.8;
67
68 2.8
69 date    92.01.31.21.37.07;      author jromine; state Exp;
70 branches;
71 next    2.7;
72
73 2.7
74 date    91.02.14.15.17.56;      author mh;      state Exp;
75 branches;
76 next    2.6;
77
78 2.6
79 date    90.11.05.12.06.39;      author mh;      state Exp;
80 branches;
81 next    2.5;
82
83 2.5
84 date    90.04.05.15.29.04;      author sources; state Exp;
85 branches;
86 next    2.4;
87
88 2.4
89 date    90.04.05.14.42.56;      author sources; state Exp;
90 branches;
91 next    2.3;
92
93 2.3
94 date    90.04.02.14.27.00;      author sources; state Exp;
95 branches;
96 next    2.2;
97
98 2.2
99 date    90.02.07.13.00.42;      author sources; state Exp;
100 branches;
101 next    2.1;
102
103 2.1
104 date    90.02.05.14.46.23;      author sources; state Exp;
105 branches;
106 next    2.0;
107
108 2.0
109 date    89.11.17.15.56.27;      author sources; state Exp;
110 branches;
111 next    1.1;
112
113 1.1
114 date    89.11.17.15.44.15;      author sources; state Exp;
115 branches;
116 next    ;
117
118
119 desc
120 @@
121
122
123 2.20
124 log
125 @change "client" to "clientname"
126 make default to use LocalName()
127 @
128 text
129 @/* mts.c - definitions for the mail transport system */
130 #ifndef lint
131 static char ident[] = "@@(#)$Id: mts.c,v 2.19 1993/09/01 20:55:38 jromine Exp jromine $";
132 #endif /* lint */
133
134 /* LINTLIBRARY */
135
136 #undef  NETWORK
137 #if     defined(BSD41A) || defined(BSD42) || defined(SOCKETS)
138 #define NETWORK
139 #endif
140
141 #include "../h/strings.h"
142 #include <ctype.h>
143 #include <stdio.h>
144 #include "mts.h"
145 #ifdef  NETWORK
146 #if     defined(BSD42) || defined(SOCKETS)
147 #include <netdb.h>
148 #endif
149 #else   /* NETWORK */
150 #ifndef SYS5
151 #include <whoami.h>
152 #else
153 #include <sys/utsname.h>
154 #endif /* SYS5 */
155 #endif /* NETWORK */
156 #include <pwd.h>
157
158
159 #define NOTOK   (-1)
160 #define OK      0
161
162 #define NULLCP  ((char *) 0)
163
164 extern int  errno;
165
166 static char   *tailor_value ();
167
168
169 #if defined(SYS5) && !defined(_AIX)
170 #define index   strchr
171 #define rindex  strrchr
172 #endif /* SYS5 */
173
174 #if !defined(__STDC__) && !defined(_AIX) && !defined(_POSIX_SOURCE)
175 char   *index (), *malloc (), *mktemp (), *rindex (), *strcpy ();
176
177 #ifdef  SYS5
178 struct passwd  *getpwuid ();
179 #endif
180 #endif /* !__STDC__ */
181
182 /* \f */
183
184 /*
185    *mmdfldir and *uucpldir are the maildrop directories.  If maildrops
186    are kept in the user's home directory, then these should be empty
187    strings.  In this case, the appropriate ...lfil array should contain
188    the name of the file in the user's home directory.  Usually, this is
189    something like ".mail".
190  */
191
192 static char *mtstailor = "@@(MHETCPATH)/mtstailor";
193
194 static char    *localname = "";
195 static char    *localdomain = "";
196 static char    *systemname = "";
197 #ifdef  MF
198 static char    *UUCPchan = "";
199 #endif /* MF */
200 char    *mmdfldir = "@@(MHDROPATH)";
201 char    *mmdflfil = "@@(MHDROPFIL)";
202 char    *uucpldir = "/usr/spool/mail";
203 char    *uucplfil = "";
204
205
206 char    *mmdlm1 = "\001\001\001\001\n";
207 char    *mmdlm2 = "\001\001\001\001\n";
208
209
210 static int  MMailids = 0;
211 static char *mmailid = "0";
212
213
214 #ifdef  MF
215 char   *umincproc = "@@(MHETCPATH)/uminc";
216 #else /* MF */
217 char   *umincproc = NULL;
218 #endif /* MF */
219
220
221 int     lockstyle = LOK_UNIX;
222 static char *lkstyle = "0";
223 char   *lockldir = "";
224
225 /* \f */
226
227 /* MTS specific variables */
228
229 #ifdef  MHMTS
230 char   *Mailqdir = "/usr/spool/netmail";
231 char   *TMailqdir = "/usr/tmp";
232 int     Syscpy = 1;
233 static char *syscpy = "1";
234 char   *Overseer = "root";
235 char   *Mailer = "root";
236 char   *Fromtmp = "/tmp/rml.f.XXXXXX";
237 char   *Msgtmp = "/tmp/rml.m.XXXXXX";
238 char   *Errtmp = "/tmp/rml.e.XXXXXX";
239 int     Tmpmode = 0600;
240 static char *tmpmode = "0600";
241 char   *Okhosts = "@@(MHETCPATH)/Rmail.OkHosts";
242 char   *Okdests = "@@(MHETCPATH)/Rmail.OkDests";
243 #endif /* MHMTS */
244
245 #ifdef  MMDFMTS
246 #endif /* MMDFMTS */
247
248 #ifdef  SENDMTS
249 char   *hostable = "@@(MHETCPATH)/hosts";
250 char   *sendmail = "/usr/lib/sendmail";
251 #endif /* SENDMTS */
252
253
254 /* SMTP/POP stuff */
255
256 char   *clientname = (char *)0;
257 char   *servers = "localhost \01localnet";
258 char   *pophost = "";
259
260
261 /* BBoards-specific variables */
262
263 char   *bb_domain = "";
264
265
266 /* POP BBoards-specific variables */
267
268 #ifdef  BPOP
269 char    *popbbhost = "";
270 char    *popbbuser = "";
271 char    *popbblist = "@@(MHETCPATH)/hosts.popbb";
272 #endif /* BPOP */
273
274
275 /* MailDelivery */
276
277 char   *maildelivery = "@@(MHETCPATH)/maildelivery";
278
279
280 /* Aliasing Facility (doesn't belong here) */
281
282 int     Everyone = NOTOK;
283 static char *everyone = "-1";
284 char   *NoShell = "";
285
286 /* \f */
287
288 /* customize the MTS settings for MH by reading @@(MHETCPATH)/mtstailor */
289
290 static  struct bind {
291     char   *keyword;
292     char  **value;
293 }       binds[] = {
294     "localname", &localname,
295     "localdomain", &localdomain,
296     "systemname", &systemname,
297 #ifdef  MF
298     "uucpchan", &UUCPchan,
299 #endif /* MF */
300     "mmdfldir", &mmdfldir,
301     "mmdflfil", &mmdflfil,
302     "uucpldir", &uucpldir,
303     "uucplfil", &uucplfil,
304     "mmdelim1", &mmdlm1,
305     "mmdelim2", &mmdlm2,
306     "mmailid", &mmailid,
307     "umincproc", &umincproc,
308     "lockstyle", &lkstyle,
309     "lockldir", &lockldir,
310
311 #ifdef  MHMTS
312     "mailqdir", &Mailqdir,
313     "tmailqdir", &TMailqdir,
314     "syscpy", &syscpy,
315     "overseer", &Overseer,
316     "mailer", &Mailer,
317     "fromtmp", &Fromtmp,
318     "msgtmp", &Msgtmp,
319     "errtmp", &Errtmp,
320     "tmpmode", &tmpmode,
321     "okhosts", &Okhosts,
322     "okdests", &Okdests,
323 #endif /* MHMTS */
324
325 #ifdef  MMDFMTS
326 #endif /* MMDFMTS */
327
328 #ifdef  SENDMTS
329     "hostable", &hostable,
330     "sendmail", &sendmail,
331 #endif /* SENDMTS */
332
333     "clientname",  &clientname,
334     "servers", &servers,
335     "pophost", &pophost,
336
337     "bbdomain", &bb_domain,
338
339 #ifdef  BPOP
340     "popbbhost", &popbbhost,
341     "popbbuser", &popbbuser,
342     "popbblist", &popbblist,
343 #endif /* BPOP */
344 #ifdef  NNTP
345     "nntphost", &popbbhost,
346 #endif /* NNTP */
347
348     "maildelivery", &maildelivery,
349
350     "everyone", &everyone,
351     "noshell", &NoShell,
352
353     NULL
354 };
355
356 /* \f */
357
358 /* I'd like to use m_getfld() here, but not all programs loading mts.o may be
359    MH-style programs... */
360
361 /* ARGSUSED */
362
363 mts_init (name)
364 char    *name;
365 {
366     register char  *bp,
367                    *cp;
368     char    buffer[BUFSIZ];
369     register struct bind   *b;
370     register    FILE *fp;
371     static int  inited = 0;
372
373     if (inited++ || (fp = fopen (mtstailor, "r")) == NULL)
374         return;
375
376     while (fgets (buffer, sizeof buffer, fp)) {
377         if ((cp = index (buffer, '\n')) == NULL)
378             break;
379         *cp = 0;
380         if (*buffer == '#' || *buffer == '\0')
381             continue;
382         if ((bp = index (buffer, ':')) == NULL)
383             break;
384         *bp++ = 0;
385         while (isspace (*bp))
386             *bp++ = 0;
387
388         for (b = binds; b -> keyword; b++)
389             if (strcmp (buffer, b -> keyword) == 0)
390                 break;
391         if (b -> keyword && (cp = tailor_value (bp)))
392             *b -> value = cp;
393     }
394
395     (void) fclose (fp);
396
397     MMailids = atoi (mmailid);
398     if ((lockstyle = atoi (lkstyle)) < LOK_UNIX || lockstyle > LOK_MMDF)
399         lockstyle = LOK_UNIX;
400 #ifdef  MHMTS
401     Syscpy = atoi (syscpy);
402     (void) sscanf (tmpmode, "0%o", &Tmpmode);
403 #endif /* MHMTS */
404     Everyone = atoi (everyone);
405 }
406
407 /* \f */
408
409 #define QUOTE   '\\'
410
411 static char *tailor_value (s)
412 register char   *s;
413 {
414     register int    i,
415                     r;
416     register char  *bp;
417     char    buffer[BUFSIZ];
418
419     for (bp = buffer; *s; bp++, s++)
420         if (*s != QUOTE)
421             *bp = *s;
422         else
423             switch (*++s) {
424 #define grot(y,z) case y: *bp = z; break;
425                 grot ('b', '\b');
426                 grot ('f', '\f');
427                 grot ('n', '\n');
428                 grot ('t', '\t');
429 #undef  grot
430
431                 case 0: s--;
432                 case QUOTE: 
433                     *bp = QUOTE;
434                     break;
435
436                 default: 
437                     if (!isdigit (*s)) {
438                         *bp++ = QUOTE;
439                         *bp = *s;
440                     }
441                     r = *s != '0' ? 10 : 8;
442                     for (i = 0; isdigit (*s); s++)
443                         i = i * r + *s - '0';
444                     s--;
445                     *bp = toascii (i);
446                     break;
447             }
448     *bp = 0;
449
450     bp = malloc ((unsigned) (strlen (buffer) + 1));
451     if (bp != NULL)
452         (void) strcpy (bp, buffer);
453
454     return bp;
455 }
456
457 /* \f */
458
459 char   *LocalName () {
460 #ifdef  BSD41A
461     char  *myname;
462 #endif /* BSD41A */
463 #if     defined(BSD42) || defined(SOCKETS)
464     register struct hostent *hp;
465 #endif /* BSD42 or SOCKETS */
466 #if     defined(SYS5) && !defined(NETWORK)
467     struct utsname name;
468 #endif /* SYS5 and not NETWORK */
469     static char buffer[BUFSIZ] = "";
470
471     if (buffer[0])
472         return buffer;
473
474     mts_init ("mts");
475     if (*localname)
476         strcpy (buffer, localname);
477     else {
478
479 #ifdef  locname
480     (void) strcpy (buffer, locname);
481 #else /* not locname */
482 #ifdef  NETWORK
483 #ifdef  BSD41A
484     myname = "myname";
485     if (rhost (&myname) == -1)
486         (void) gethostname (buffer, sizeof buffer);
487     else {
488         (void) strcpy (buffer, myname);
489         free (myname);
490     }
491 #endif /* BSD41A */
492 #if     defined(BSD42) || defined(SOCKETS)
493     (void) gethostname (buffer, sizeof buffer);
494 #ifndef BIND
495     sethostent (1);
496 #endif
497     if (hp = gethostbyname (buffer))
498         (void) strcpy (buffer, hp -> h_name);
499 #endif /* BSD42 or SOCKETS */
500 #else /* not NETWORK */
501 #ifndef SYS5
502     (void) strcpy (buffer, SystemName ());
503 #else /* SYS5 */
504     (void) uname (&name);
505     (void) strcpy (buffer, name.nodename);
506 #endif /* SYS5 */
507 #endif /* not NETWORK */
508 #endif /* not locname */
509     }
510     if (*localdomain) {
511         strcat (buffer, ".");
512         strcat (buffer, localdomain);
513     }
514     return buffer;
515 }
516
517 /* \f */
518
519 char *SystemName () {
520 #if     defined(SYS5) && !defined(NETWORK)
521     struct utsname name;
522 #endif /* SYS5 and not NETWORK */
523     static char buffer[BUFSIZ] = "";
524
525     if (buffer[0])
526         return buffer;
527
528     mts_init ("mts");
529     if (*systemname)
530         return strcpy (buffer, systemname);
531
532 #ifdef  sysname
533     (void) strcpy (buffer, sysname);
534 #else /* sysname */
535 #if     !defined(SYS5) || defined(NETWORK)
536     (void) gethostname (buffer, sizeof buffer);
537 #else /* SYS5 and not NETWORK */
538 #ifdef  SYS5
539     (void) uname (&name);
540     (void) strcpy (buffer, name.nodename);
541 #endif /* SYS5 */
542 #endif /* SYS5 and not NETWORK */
543 #endif /* sysname */
544
545     return buffer;
546 }
547
548 /* \f */
549
550 char   *UucpChan () {
551 #ifdef  MF
552     static char buffer[BUFSIZ] = "";
553 #endif /* MF */
554
555 #ifndef MF
556     return NULL;
557 #else /* MF */
558     if (buffer[0])
559         return buffer;
560
561     mts_init ("mts");
562     if (*UUCPchan)
563         return strcpy (buffer, UUCPchan);
564
565 #ifdef  uucpchan
566     (void) strcpy (buffer, uucpchan);
567 #else /* uucpchan */
568     (void) strcpy (buffer, "uucp");
569 #endif /* uucpchan */
570     return buffer;
571 #endif /* MF */
572 }
573
574 /* \f */
575
576 #ifdef  ALTOS
577 gethostname (name, len)
578 register char   *name;
579 register int     len;
580 {
581     register char  *cp;
582     register FILE  *fp;
583
584     if (fp = fopen ("/etc/systemid", "r")) {
585         if (fgets (name, len, fp)) {
586             if (cp = index (name, '\n'))
587                 *cp = 0;
588             (void) fclose (fp);
589             return OK;
590         }
591         (void) fclose (fp);
592     }
593     (void) strncpy (name, "altos", len);
594
595     return OK;
596 }
597 #endif /* ALTOS */
598
599 /* \f */
600
601 static char username[BUFSIZ];
602 static char fullname[BUFSIZ];
603
604
605 char   *getusr () {
606     register char  *cp,
607                    *np;
608 #ifdef KPOP
609     int uid;
610 #endif /* KPOP */
611     register struct passwd *pw;
612
613     if (username[0])
614         return username;
615
616 #ifndef KPOP
617     if ((pw = getpwuid (getuid ())) == NULL
618             || pw -> pw_name == NULL
619             || *pw -> pw_name == NULL) {
620 #else /* KPOP */
621     uid = getuid ();
622     if (uid == geteuid () && (cp = getenv ("USER")) != NULL
623         && (pw = getpwnam (cp)) != NULL)
624       strcpy (username, cp);
625     else if ((pw = getpwuid (uid)) == NULL
626              || pw -> pw_name == NULL
627              || *pw -> pw_name == '\0') {
628 #endif /* KPOP */
629         (void) strcpy (username, "unknown");
630         (void) sprintf (fullname, "The Unknown User-ID (%d)", getuid ());
631         return username;
632     }
633
634     np = pw -> pw_gecos;
635 #ifndef GCOS_HACK
636     for (cp = fullname; *np && *np != (MMailids ? '<' : ','); *cp++ = *np++)
637         continue;
638 #else
639     for (cp = fullname; *np && *np != (MMailids ? '<' : ','); )
640         if (*np == '&') {       /* blech! */
641             (void) strcpy(cp, pw -> pw_name);
642             *cp = toupper(*cp);
643             while (*cp)
644                 cp++;
645             np++;
646         }
647         else
648             *cp++ = *np++;
649 #endif
650     *cp = '\0';
651     if (MMailids) {
652         if (*np)
653             np++;
654         for (cp = username; *np && *np != '>'; *cp++ = *np++)
655             continue;
656         *cp = '\0';
657     }
658     if (MMailids == 0 || *np == '\0')
659         (void) strcpy (username, pw -> pw_name);
660
661     if ((cp = getenv ("SIGNATURE")) && *cp)
662         (void) strcpy (fullname, cp);
663     if (index(fullname, '.')) {         /*  quote any .'s */
664           char tmp[BUFSIZ];
665       sprintf (tmp, "\"%s\"", fullname);/* should quote "'s too */
666       strcpy (fullname, tmp);
667     }
668
669     return username;
670 }
671
672
673 char   *getfullname () {
674     if (username[0] == '\0')
675         (void) getusr ();
676
677     return fullname;
678 }
679
680 /* \f */
681
682 #ifdef  SYS5
683 #ifndef notdef                  /* Supposedly this works, I prefer the
684                                    recursive solution... */
685
686 #include <fcntl.h>
687
688 int     dup2 (d1, d2)
689 register int    d1,
690                 d2;
691 {
692     int     d;
693
694     if (d1 == d2)
695         return OK;
696
697     (void) close (d2);
698     if ((d = fcntl (d1, F_DUPFD, d2)) == NOTOK)
699         return NOTOK;
700     if (d == d2)
701         return OK;
702
703     errno = 0;
704     return NOTOK;
705 }
706
707 #else /* notdef */
708 int     dup2 (d1, d2)
709 register int    d1,
710                 d2;
711 {
712     if (d1 == d2)
713         return OK;
714
715     (void) close (d2);
716     return dup2aux (d1, d2);
717 }
718
719
720 static int  dup2aux (d1, d2)
721 register int    d1,
722                 d2;
723 {
724     int     d,
725             i,
726             eindex;
727
728     if ((d = dup (d1)) == NOTOK)
729         return NOTOK;
730     if (d == d2)
731         return OK;
732
733     i = dup2aux (d1, d2);
734     eindex = errno;
735     (void) close (d);
736     errno = eindex;
737     return i;
738 }
739 #endif /* notdef */
740 #endif /* SYS5 */
741 @
742
743
744 2.19
745 log
746 @and "client" (clientname) tailor option
747 @
748 text
749 @d3 1
750 a3 1
751 static char ident[] = "@@(#)$Id: mts.c,v 2.18 1993/08/19 23:36:12 jromine Exp jromine $";
752 d128 1
753 a128 1
754 char   *clientname = "";
755 d205 1
756 a205 1
757     "client",  &clientname,
758 @
759
760
761 2.18
762 log
763 @use GCOS_HACK (instead of FINGER_HACK)
764 @
765 text
766 @d3 1
767 a3 1
768 static char ident[] = "@@(#)$Id: mts.c,v 2.17 1993/08/19 23:08:05 jromine Exp jromine $";
769 d128 1
770 d205 1
771 @
772
773
774 2.17
775 log
776 @add FINGER_HACK
777 @
778 text
779 @d3 1
780 a3 1
781 static char ident[] = "@@(#)$Id: mts.c,v 2.16 1992/11/24 18:40:34 jromine Exp jromine $";
782 d505 1
783 a505 1
784 #ifndef FINGER_HACK
785 @
786
787
788 2.16
789 log
790 @fix decl
791 @
792 text
793 @d3 1
794 a3 1
795 static char ident[] = "@@(#)$Id: mts.c,v 2.15 1992/11/02 18:58:12 jromine Exp jromine $";
796 d505 1
797 d508 12
798 @
799
800
801 2.15
802 log
803 @_AIX
804 @
805 text
806 @d3 1
807 a3 1
808 static char ident[] = "@@(#)$Id: mts.c,v 2.14 1992/05/19 20:51:57 jromine Exp jromine $";
809 d38 1
810 a38 1
811 char   *tailor_value ();
812 @
813
814
815 2.14
816 log
817 @AIX
818 @
819 text
820 @d3 1
821 a3 1
822 static char ident[] = "@@(#)$Id: mts.c,v 2.13 1992/05/12 21:46:45 jromine Exp jromine $";
823 d41 1
824 a41 1
825 #ifdef  SYS5
826 @
827
828
829 2.13
830 log
831 @fix ifdefs
832 @
833 text
834 @d3 1
835 a3 1
836 static char ident[] = "@@(#)$Id: mts.c,v 2.12 1992/02/10 18:12:35 jromine Exp jromine $";
837 d46 1
838 a46 1
839 #ifndef __STDC__
840 @
841
842
843 2.12
844 log
845 @some SVR4 changes
846 add "localdomain" tailor option
847 @
848 text
849 @d3 2
850 a4 2
851 static char ident[] = "@@(#)$Id: mts.c,v 2.11 1992/02/05 17:08:16 jromine Exp jromine $";
852 #endif  lint
853 d44 1
854 a44 1
855 #endif  SYS5
856 d71 1
857 a71 1
858 #endif  MF
859 d88 1
860 a88 1
861 #else   MF
862 d90 1
863 a90 1
864 #endif  MF
865 d115 1
866 a115 1
867 #endif  MHMTS
868 d118 1
869 a118 1
870 #endif  MMDFMTS
871 d123 1
872 a123 1
873 #endif  SENDMTS
874 d143 1
875 a143 1
876 #endif  BPOP
877 d170 1
878 a170 1
879 #endif  MF
880 d194 1
881 a194 1
882 #endif  MHMTS
883 d197 1
884 a197 1
885 #endif  MMDFMTS
886 d202 1
887 a202 1
888 #endif  SENDMTS
889 d213 1
890 a213 1
891 #endif  BPOP
892 d216 1
893 a216 1
894 #endif  NNTP
895 d273 1
896 a273 1
897 #endif  MHMTS
898 d332 1
899 a332 1
900 #endif  BSD41A
901 d335 1
902 a335 1
903 #endif  BSD42 or SOCKETS
904 d338 1
905 a338 1
906 #endif  SYS5 and not NETWORK
907 d351 1
908 a351 1
909 #else   not locname
910 d361 1
911 a361 1
912 #endif  BSD41A
913 d369 2
914 a370 2
915 #endif  BSD42 or SOCKETS
916 #else   not NETWORK
917 d373 1
918 a373 1
919 #else   SYS5
920 d376 3
921 a378 3
922 #endif  SYS5
923 #endif  not NETWORK
924 #endif  not locname
925 d392 1
926 a392 1
927 #endif  SYS5 and not NETWORK
928 d404 1
929 a404 1
930 #else   sysname
931 d407 1
932 a407 1
933 #else   SYS5 and not NETWORK
934 d411 3
935 a413 3
936 #endif  SYS5
937 #endif  SYS5 and not NETWORK
938 #endif  sysname
939 d423 1
940 a423 1
941 #endif  MF
942 d427 1
943 a427 1
944 #else   MF
945 d437 1
946 a437 1
947 #else   uucpchan
948 d439 1
949 a439 1
950 #endif  uucpchan
951 d441 1
952 a441 1
953 #endif  MF
954 d467 1
955 a467 1
956 #endif  ALTOS
957 d480 1
958 a480 1
959 #endif KPOP
960 d490 1
961 a490 1
962 #else KPOP
963 d498 1
964 a498 1
965 #endif KPOP
966 d564 1
967 a564 1
968 #else   notdef
969 d596 2
970 a597 2
971 #endif  notdef
972 #endif  SYS5
973 @
974
975
976 2.11
977 log
978 @put getpwnam(USER) under #ifdef KPOP
979 this is a major lose for shared accounts
980 @
981 text
982 @d3 1
983 a3 1
984 static char ident[] = "@@(#)$Id: mts.c,v 2.10 1992/02/03 17:49:13 jromine Exp $";
985 d67 1
986 d166 1
987 d346 2
988 a347 1
989         return strcpy (buffer, localname);
990 d379 5
991 a383 1
992
993 @
994
995
996 2.10
997 log
998 @SYS5
999 @
1000 text
1001 @d3 1
1002 a3 1
1003 static char ident[] = "@@(#)$Id: mts.c,v 2.9 1992/02/03 16:34:00 jromine Exp jromine $";
1004 d471 1
1005 d473 1
1006 d479 5
1007 d491 1
1008 @
1009
1010
1011 2.9
1012 log
1013 @kerberos
1014 @
1015 text
1016 @d3 1
1017 a3 1
1018 static char ident[] = "@@(#)$Id: mts.c,v 2.8 1992/01/31 21:37:07 jromine Exp jromine $";
1019 d49 1
1020 d51 1
1021 @
1022
1023
1024 2.8
1025 log
1026 @kerberos
1027 @
1028 text
1029 @d3 1
1030 a3 1
1031 static char ident[] = "@@(#)$Id: mts.c,v 2.7 1991/02/14 15:17:56 mh Exp jromine $";
1032 d46 1
1033 d50 1
1034 @
1035
1036
1037 2.7
1038 log
1039 @set signature from gecos field of passwd file.  $SIGNATURE
1040 will override this
1041 @
1042 text
1043 @d3 1
1044 a3 1
1045 static char ident[] = "@@(#)$Id: mts.c,v 2.6 90/11/05 12:06:39 mh Exp Locker: mh $";
1046 d11 1
1047 a11 1
1048 #endif  not (defined(BSD41A) || defined(BSD42) || defined(SOCKETS))
1049 d20 2
1050 a21 2
1051 #endif  BSD42 or SOCKETS
1052 #else   not NETWORK
1053 d24 1
1054 a24 1
1055 #else SYS5
1056 d26 2
1057 a27 2
1058 #endif SYS5
1059 #endif  not NETWORK
1060 d243 2
1061 a244 2
1062         *cp = NULL;
1063         if (*buffer == '#' || *buffer == NULL)
1064 d248 1
1065 a248 1
1066         *bp++ = NULL;
1067 d250 1
1068 a250 1
1069             *bp++ = NULL;
1070 d295 1
1071 a295 1
1072                 case NULL: s--;
1073 d312 1
1074 a312 1
1075     *bp = NULL;
1076 d446 1
1077 a446 1
1078                 *cp = NULL;
1079 d460 2
1080 a461 2
1081 static char username[BUFSIZ] = "";
1082 static char fullname[BUFSIZ] = "";
1083 d467 1
1084 d473 7
1085 a479 3
1086     if ((pw = getpwuid (getuid ())) == NULL
1087             || pw -> pw_name == NULL
1088             || *pw -> pw_name == NULL) {
1089 d488 1
1090 a488 1
1091     *cp = NULL;
1092 d494 1
1093 a494 1
1094         *cp = NULL;
1095 d496 1
1096 a496 1
1097     if (MMailids == 0 || *np == NULL)
1098 d512 1
1099 a512 1
1100     if (username[0] == NULL)
1101 @
1102
1103
1104 2.6
1105 log
1106 @quote bad signatures with "..."
1107 JLR
1108 @
1109 text
1110 @d3 1
1111 a3 1
1112 static char ident[] = "@@(#)$Id: mts.c,v 2.5 90/04/05 15:29:04 sources Exp Locker: mh $";
1113 d480 4
1114 a484 4
1115         np = pw -> pw_gecos;
1116         for (cp = fullname; *np && *np != '<'; *cp++ = *np++)
1117             continue;
1118         *cp = NULL;
1119 d491 1
1120 a491 1
1121     if (MMailids == 0 || *np == NULL) {
1122 d493 1
1123 a493 2
1124         fullname[0] = NULL;
1125     }
1126 d498 1
1127 a498 1
1128       sprintf (tmp, "\"%s\"", fullname);
1129 @
1130
1131
1132 2.5
1133 log
1134 @add ID
1135 @
1136 text
1137 @d3 1
1138 a3 1
1139 static char ident[] = "@@(#)$Id:$";
1140 a490 8
1141     /*
1142      *  If the fullname contains any .'s, quote it
1143      */
1144     if (index(fullname, '.')) {
1145           char tmp[BUFSIZ];
1146       sprintf (tmp, "\"%s\"", fullname);
1147       strcpy (fullname, tmp);
1148     }
1149 d497 5
1150 @
1151
1152
1153 2.4
1154 log
1155 @add ID
1156 @
1157 text
1158 @d3 1
1159 a3 1
1160 static char ident[] = "$Id:";
1161 @
1162
1163
1164 2.3
1165 log
1166 @"intruder" -> "unknown"
1167 quote any full names with "."s
1168 @
1169 text
1170 @d2 3
1171 @
1172
1173
1174 2.2
1175 log
1176 @ANSI Compliance
1177 @
1178 text
1179 @d472 1
1180 a472 1
1181         (void) strcpy (username, "intruder");
1182 d487 8
1183 @
1184
1185
1186 2.1
1187 log
1188 @new #define SOCKETS for non-bsd machines with socket(), et. al.
1189 @
1190 text
1191 @a270 1
1192 #define grot(x) case 'x': *bp = '\x'; break
1193 d285 6
1194 a290 4
1195                 grot (b);
1196                 grot (f);
1197                 grot (n);
1198                 grot (t);
1199 @
1200
1201
1202 2.0
1203 log
1204 @changes for SUN40 shared libraries and NNTP under bbc
1205 @
1206 text
1207 @d6 1
1208 a6 1
1209 #if     defined(BSD41A) || defined(BSD42)
1210 d8 1
1211 a8 1
1212 #endif  not (defined(BSD41A) || defined(BSD42))
1213 d15 1
1214 a15 1
1215 #ifdef  BSD42
1216 d17 1
1217 a17 1
1218 #endif  BSD42
1219 d323 1
1220 a323 1
1221 #ifdef  BSD42
1222 d325 2
1223 a326 2
1224 #endif  BSD42
1225 #ifdef  SYS5
1226 d328 1
1227 a328 1
1228 #endif  SYS5
1229 d351 1
1230 a351 1
1231 #ifdef  BSD42
1232 d358 1
1233 a358 1
1234 #endif  BSD42
1235 d375 1
1236 a375 1
1237 #ifdef  SYS5
1238 d377 1
1239 a377 1
1240 #endif  SYS5
1241 d390 1
1242 a390 1
1243 #ifndef SYS5
1244 d392 2
1245 a393 1
1246 #else   SYS5
1247 d397 1
1248 @
1249
1250
1251 1.1
1252 log
1253 @Initial revision
1254 @
1255 text
1256 @d205 3
1257 @