home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1585 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  34.4 KB

  1. From: csu@alembic.acs.com (Dave Mack)
  2. Newsgroups: alt.sources
  3. Subject: Anonymous Contact Service software v1.1, Part06/08
  4. Message-ID: <1990Jul15.171148.7121@alembic.acs.com>
  5. Date: 15 Jul 90 17:11:48 GMT
  6.  
  7. This is the second distribution of the Anonymous Contact Service
  8. software. The distribution consists of 8 shar files. This will
  9. (hopefully) be the last full distribution of the system - all
  10. future versions will be distributed as patches. The patchlevel of
  11. this version is 1.
  12.  
  13. The ACS software provides a mechanism for posting anonymous articles,
  14. for receiving replies to those articles which are also anonymous, and
  15. permits prolonged anonymous conversations in which neither writer knows
  16. the other's actual e-mail address.
  17.  
  18. This software is currently being used to provide an anonymous personals
  19. service in alt.personals.
  20.  
  21. Dave Mack
  22. csu@alembic.ACS.COM
  23.  
  24. #! /bin/sh
  25. # This is a shell archive.  Remove anything before this line, then unpack
  26. # it by saving it into a file and typing "sh file".  To overwrite existing
  27. # files, type "sh file -c".  You can also feed this as standard input via
  28. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  29. # will see the following message at the end:
  30. #        "End of archive 6 (of 8)."
  31. # Contents:  mailer/alias.c mailer/defs.h mailer/smail.8
  32. # Wrapped by csu@alembic on Sun Jul 15 12:46:52 1990
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'mailer/alias.c' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'mailer/alias.c'\"
  36. else
  37. echo shar: Extracting \"'mailer/alias.c'\" \(11011 characters\)
  38. sed "s/^X//" >'mailer/alias.c' <<'END_OF_FILE'
  39. X#ifndef lint
  40. Xstatic char *sccsid = "@(#)alias.c    2.5 (smail) 9/15/87";
  41. X#endif
  42. X
  43. X#include <stdio.h>
  44. X#include <sys/types.h>
  45. X#include <sys/stat.h>
  46. X#include <pwd.h>
  47. X#include "defs.h"
  48. X#include <ctype.h>
  49. X
  50. Xextern enum edebug debug;    /* verbose and debug modes        */
  51. Xextern char hostdomain[];
  52. Xextern char hostname[];
  53. Xextern char *aliasfile;
  54. X
  55. X/*
  56. X**
  57. X** Picture of the alias graph structure
  58. X**
  59. X**    head
  60. X**       |
  61. X**       v
  62. X**    maps -> mark -> gjm -> mel -> NNULL
  63. X**       |
  64. X**       v
  65. X**    sys ->  root -> ron -> NNULL
  66. X**       |
  67. X**       v
  68. X**    root -> mark -> chris -> lda -> NNULL
  69. X**       |
  70. X**       v
  71. X**      NNULL
  72. X*/
  73. X
  74. Xtypedef struct alias_node node;
  75. X
  76. Xstatic struct alias_node {
  77. X    char *string;
  78. X    node *horz;
  79. X    node *vert;
  80. X};
  81. X
  82. X#ifndef SENDMAIL
  83. Xstatic node aliases = {"", 0, 0}; /* this is the 'dummy header' */
  84. X#endif /* not SENDMAIL */
  85. X
  86. X/*
  87. X** lint free forms of NULL
  88. X*/
  89. X
  90. X#define NNULL    ((node   *) 0)
  91. X#define CNULL    ('\0')
  92. X
  93. X/*
  94. X** string parsing macros
  95. X*/
  96. X#define SKIPWORD(Z)  while(*Z!=' ' && *Z!='\t' && *Z!='\n' && *Z!=',') Z++;
  97. X#define SKIPSPACE(Z) while(*Z==' ' || *Z=='\t' || *Z=='\n' || *Z==',') Z++;
  98. X
  99. Xstatic int nargc = 0;
  100. Xstatic char *nargv[MAXARGS];
  101. X
  102. Xvoid    add_horz();
  103. Xvoid    load_alias(), strip_comments();
  104. Xint    recipients();
  105. Xnode    *pop();
  106. X#ifndef SENDMAIL
  107. Xnode    *v_search(), *h_search();
  108. Xchar    *tilde();
  109. X#endif    /* not SENDMAIL */
  110. X
  111. X/* our horizontal linked list looks like a stack */
  112. X#define push        add_horz
  113. X
  114. X#define escape(s)    ((*s != '\\') ? (s) : (s+1))
  115. X
  116. Xchar **
  117. Xalias(pargc, argv)
  118. Xint *pargc;
  119. Xchar **argv;
  120. X{
  121. X/*
  122. X**  alias the addresses
  123. X*/
  124. X    int    i;
  125. X    char    domain[SMLBUF], ubuf[SMLBUF], *user;
  126. X    node    *addr, addrstk;
  127. X    node    *flist,  fliststk, *u;
  128. X
  129. X#ifndef SENDMAIL
  130. X    FILE    *fp;
  131. X    node    *a;
  132. X    char    *home, buf[SMLBUF];
  133. X    int    aliased;
  134. X    struct    stat st;
  135. X#endif /* not SENDMAIL */
  136. X
  137. X#ifdef FULLNAME
  138. X    char *res_fname();    /* Does fullname processing */
  139. X#endif
  140. X
  141. X    addr  = &addrstk;
  142. X    flist = &fliststk;
  143. X    user  = ubuf;
  144. X
  145. X    addr->horz = NNULL;
  146. X    flist->horz  = NNULL;
  147. X
  148. X    /*
  149. X    ** push all of the addresses onto a stack
  150. X    */
  151. X    for(i=0; i < *pargc; i++) {
  152. X        push(addr, argv[i]);
  153. X    }
  154. X
  155. X    /*
  156. X    ** for each adress, check for included files, aliases,
  157. X    ** full name mapping, and .forward files
  158. X    */
  159. X
  160. X    while((nargc < MAXARGS) && ((u = pop(addr)) != NNULL)) {
  161. X#ifndef SENDMAIL
  162. X        if(strncmpic(u->string, ":include:", 9) == 0) {
  163. X            /*
  164. X            ** make sure it's a full path name
  165. X            ** don't allow multiple sourcing
  166. X            ** of a given include file
  167. X            */
  168. X            char *p = u->string + 9;
  169. X
  170. X            if((*p == '/')
  171. X            && (h_search(flist, p) == NULL)) {
  172. X                push(flist, p);
  173. X                if((stat(p, &st) >= 0)
  174. X                &&((st.st_mode & S_IFMT) == S_IFREG)
  175. X                &&((fp = fopen(p, "r")) != NULL)) {
  176. X                    while(fgets(buf, sizeof buf, fp)) {
  177. X                        (void) recipients(addr, buf);
  178. X                    }
  179. X                    (void) fclose(fp);
  180. X                }
  181. X            }
  182. X            continue;
  183. X        }
  184. X#endif /* not SENDMAIL */
  185. X        /*
  186. X        ** parse the arg to see if it's to be aliased
  187. X        */
  188. X
  189. X        if(islocal(u->string, domain, ubuf) == 0) {
  190. X            goto aliasing_complete;
  191. X        }
  192. X
  193. X        /*
  194. X        ** local form - try to alias user
  195. X        ** aliases file takes precedence over ~user/.forward
  196. X        ** since that's the way that sendmail does it.
  197. X        */
  198. X
  199. X#ifdef LOWERLOGNAME
  200. X        /* squish 'user' into lower case */
  201. X        for(user = ubuf; *user ; user++) {
  202. X            *user = lower(*user);
  203. X        }
  204. X#endif
  205. X        user = escape(ubuf);
  206. X
  207. X        (void) strcpy(u->string, user);    /* local => elide domain */
  208. X#ifndef SENDMAIL
  209. X        /*
  210. X        ** check for alias - all this complication is necessary
  211. X        ** to handle perverted aliases like these:
  212. X        ** # mail to 's' resolves to 't' 'm' and 'rmt!j'
  213. X        ** s    t,g,j,m
  214. X        ** g    j,m
  215. X        ** j    rmt!j
  216. X        ** # mail to 'a' resolves to 'rmt!d'
  217. X        ** a    b c
  218. X        ** b    c
  219. X        ** c    rmt!d
  220. X        ** # mail to x resolves to 'x'
  221. X        ** x    local!x
  222. X        ** # mail to 'y' resolves to 'y' and 'z'
  223. X        ** y    \y z
  224. X        */
  225. X        if(((a = v_search(user)) != NNULL)) {
  226. X            char dtmpb[SMLBUF], utmpb[SMLBUF], *ut;
  227. X            int user_inalias = 0;
  228. X            node *t = a;
  229. X
  230. X            for(a = a->horz; a != NNULL; a=a->horz) {
  231. X                if(islocal(a->string, dtmpb, utmpb)) {
  232. X#ifdef LOWERLOGNAME
  233. X                    /* squish 'utmpb' into lower case */
  234. X                    for(ut = utmpb; *ut ; ut++) {
  235. X                        *ut = lower(*ut);
  236. X                    }
  237. X#endif
  238. X
  239. X                    ut = escape(utmpb);
  240. X#ifdef CASEALIAS
  241. X                    if(strcmp(ut, user) == 0)
  242. X#else
  243. X                    if(strcmpic(ut, user) == 0)
  244. X#endif
  245. X                    {
  246. X                        user_inalias = 1;
  247. X                    } else {
  248. X                        push(addr, a->string);
  249. X                    }
  250. X                } else {
  251. X                    push(addr, a->string);
  252. X                }
  253. X            }
  254. X            t->horz = NNULL; /* truncate horz list of aliases */
  255. X            if(user_inalias == 0) {
  256. X                continue;
  257. X            }
  258. X        }
  259. X
  260. X        if((home = tilde(user)) != NULL) {
  261. X            /* don't allow multiple sourcing
  262. X            ** of a given .forward file
  263. X            */
  264. X
  265. X            if((h_search(flist, home) != NULL)) {
  266. X                continue;
  267. X            }
  268. X            push(flist, home);
  269. X
  270. X            /*
  271. X            ** check for ~user/.forward file
  272. X            ** must be a regular, readable file
  273. X            */
  274. X
  275. X            (void) sprintf(buf, "%s/%s", home, ".forward");
  276. X            if((stat(buf, &st) >= 0)
  277. X            &&((st.st_mode & S_IFMT) == S_IFREG)
  278. X            &&((st.st_mode & 0444)   == 0444)
  279. X            &&((fp = fopen(buf, "r")) != NULL)) {
  280. X                aliased = 0;
  281. X                while(fgets(buf, sizeof buf, fp)) {
  282. X                    aliased |= recipients(addr, buf);
  283. X                }
  284. X                (void) fclose(fp);
  285. X                if(aliased) {
  286. X                    continue;
  287. X                }
  288. X            }
  289. X        }
  290. X#endif /* not SENDMAIL */
  291. X
  292. X#ifdef FULLNAME
  293. X        /*
  294. X        ** Do possible fullname substitution.
  295. X        */
  296. X#ifdef DOT_REQD
  297. X        if (index(user, '.') != NULL)
  298. X#endif
  299. X        {
  300. X            static char t_dom[SMLBUF], t_unam[SMLBUF];
  301. X            char *t_user = res_fname(user);
  302. X            if (t_user != NULL) {
  303. X                if(islocal(t_user, t_dom, t_unam) == 0) {
  304. X                    /* aliased to non-local address */
  305. X                    push(addr, t_user);
  306. X                    continue;
  307. X                }
  308. X                if(strcmp(t_unam, user) != 0) {
  309. X                    /* aliased to different local address */
  310. X                    push(addr, t_unam);
  311. X                    continue;
  312. X                }
  313. X            }
  314. X        }
  315. X#endif
  316. X
  317. Xaliasing_complete:
  318. X        user = escape(u->string);
  319. X        for(i=0; i < nargc; i++) {
  320. X            if(strcmpic(nargv[i], user) == 0) {
  321. X                break;
  322. X            }
  323. X        }
  324. X
  325. X        if(i == nargc) {
  326. X            nargv[nargc++] = user;
  327. X        }
  328. X    }
  329. X    *pargc     = nargc;
  330. X    return(nargv);
  331. X}
  332. X
  333. X#ifndef SENDMAIL
  334. X/*
  335. X** v_search
  336. X**    given an string, look for its alias in
  337. X**    the 'vertical' linked list of aliases.
  338. X*/
  339. Xnode *
  340. Xv_search(user)
  341. Xchar *user;
  342. X{
  343. X    node *head;
  344. X    node *a;
  345. X    static int loaded = 0;
  346. X
  347. X    head = &aliases;
  348. X    if(loaded == 0) {
  349. X        load_alias(head, aliasfile);
  350. X        loaded = 1;
  351. X    }
  352. X
  353. X    for(a = head->vert; a != NNULL; a = a->vert) {
  354. X#ifdef CASEALIAS
  355. X        if(strcmp(a->string, user) == 0)
  356. X#else
  357. X        if(strcmpic(a->string, user) == 0)
  358. X#endif
  359. X        {
  360. X            break;
  361. X        }
  362. X    }
  363. X    if(a == NNULL) {        /* not in graph */
  364. X        return(NNULL);
  365. X    }
  366. X    return(a);
  367. X}
  368. X
  369. X/*
  370. X** h_search
  371. X**    given an string, look for it in
  372. X**    a 'horizontal' linked list of strings.
  373. X*/
  374. Xnode *
  375. Xh_search(head, str)
  376. Xnode *head;
  377. Xchar *str;
  378. X{
  379. X    node *a;
  380. X    for(a = head->horz; a != NNULL; a = a->horz) {
  381. X#ifdef CASEALIAS
  382. X        if(strcmp(a->string, str) == 0)
  383. X#else
  384. X        if(strcmpic(a->string, str) == 0)
  385. X#endif
  386. X        {
  387. X            break;
  388. X        }
  389. X    }
  390. X    return(a);
  391. X}
  392. X#endif /* not SENDMAIL */
  393. X
  394. X/*
  395. X** load_alias
  396. X**    parse an 'aliases' file and add the aliases to the alias graph.
  397. X**    Handle inclusion of other 'aliases' files.
  398. X*/
  399. X
  400. Xvoid
  401. Xload_alias(head, filename)
  402. Xnode *head;
  403. Xchar *filename;
  404. X{
  405. X    FILE *fp;
  406. X    node *v, *h, *add_vert();
  407. X    char domain[SMLBUF], user[SMLBUF];
  408. X    char *p, *b, buf[SMLBUF];
  409. X
  410. X    if((fp = fopen(filename,"r")) == NULL) {
  411. XDEBUG("load_alias open('%s') failed\n", filename);
  412. X        return;
  413. X    }
  414. X
  415. X    while(fgets(buf, sizeof buf, fp) != NULL) {
  416. X        p = buf;
  417. X        if((*p == '#') || (*p == '\n')) {
  418. X            continue;
  419. X        }
  420. X
  421. X        /*
  422. X        ** include another file of aliases
  423. X        */
  424. X
  425. X        if(strncmp(p, ":include:", 9) == 0) {
  426. X            char *nl;
  427. X            p += 9;
  428. X            if((nl = index(p, '\n')) != NULL) {
  429. X                *nl = CNULL;
  430. X            }
  431. XDEBUG("load_alias '%s' includes file '%s'\n", filename, p);
  432. X            load_alias(head, p);
  433. X            continue;
  434. X        }
  435. X
  436. X        /*
  437. X        **  if the first char on the line is a space or tab
  438. X        **  then it's a continuation line.  Otherwise,
  439. X        **  we start a new alias.
  440. X        */
  441. X        if(*p != ' ' && *p != '\t') {
  442. X            b = p;
  443. X            SKIPWORD(p);
  444. X            *p++ = CNULL;
  445. X            /*
  446. X            ** be sure that the alias is in local form
  447. X            */
  448. X            if(islocal(b, domain, user) == 0) {
  449. X                /*
  450. X                ** non-local alias format - skip it
  451. X                */
  452. X                continue;
  453. X            }
  454. X            /*
  455. X            ** add the alias to the (vertical) list of aliases
  456. X            */
  457. X            if((h = add_vert(head, user)) == NNULL) {
  458. XDEBUG("load_alias for '%s' failed\n", b);
  459. X                return;
  460. X            }
  461. X        }
  462. X        /*
  463. X        **  Next on the line is the list of recipents.
  464. X        **  Strip out each word and add it to the
  465. X        **  horizontal linked list.
  466. X        */
  467. X        (void) recipients(h, p);
  468. X    }
  469. X    (void) fclose(fp);
  470. X    /*
  471. X    ** strip out aliases which have no members
  472. X    */
  473. X    for(v = head; v->vert != NNULL; ) {
  474. X        if(v->vert->horz == NNULL) {
  475. X            v->vert = v->vert->vert;
  476. X        } else {
  477. X            v = v->vert;
  478. X        }
  479. X    }
  480. X}
  481. X
  482. X/*
  483. X** add each word in a string (*p) of recipients
  484. X** to the (horizontal) linked list associated with 'h'
  485. X*/
  486. X
  487. Xrecipients(h, p)
  488. Xnode *h;
  489. Xchar *p;
  490. X{
  491. X
  492. X    char *b, d[SMLBUF], u[SMLBUF];
  493. X    int ret = 0;
  494. X
  495. X    strip_comments(p);    /* strip out stuff in ()'s */
  496. X
  497. X    SKIPSPACE(p);        /* skip leading whitespace on line */
  498. X
  499. X    while((*p != NULL) && (*p != '#')) {
  500. X        b = p;
  501. X        if(*b == '"') {
  502. X            if((p = index(++b, '"')) == NULL) {
  503. X                /* syntax error - no matching quote */
  504. X                /* skip the rest of the line */
  505. X                return(ret);
  506. X            }
  507. X        } else {
  508. X            SKIPWORD(p);
  509. X        }
  510. X
  511. X        if(*p != CNULL) {
  512. X            *p++ = CNULL;
  513. X        }
  514. X
  515. X        /* don't allow aliases of the form
  516. X        ** a    a
  517. X        */
  518. X        if((islocal(b, d, u) == 0)
  519. X        || (strcmpic(h->string, u) != 0)) {
  520. X            add_horz(h, b);
  521. X            ret = 1;
  522. X        }
  523. X        SKIPSPACE(p);
  524. X    }
  525. X    return(ret);
  526. X}
  527. X
  528. X/*
  529. X** some aliases may have comments on the line like:
  530. X**
  531. X** moderators    moderator@somehost.domain    (Moderator's Name)
  532. X**        moderator@anotherhost.domain    (Another Moderator's Name)
  533. X**
  534. X** strip out the stuff in ()'s
  535. X**
  536. X*/
  537. X
  538. Xvoid
  539. Xstrip_comments(p)
  540. Xchar *p;
  541. X{
  542. X    char *b;
  543. X    while((p = index(p, '(')) != NULL) {
  544. X        b = p++;    /*
  545. X                ** save pointer to open parenthesis
  546. X                */
  547. X        if((p = index(p, ')')) != NULL) {/* look for close paren */
  548. X            (void) strcpy(b, ++p);     /* slide string left    */
  549. X        } else {
  550. X            *b = CNULL;    /* no paren, skip rest of line  */
  551. X            break;
  552. X        }
  553. X    }
  554. X}
  555. X
  556. X/*
  557. X** add_vert - add a (vertical) link to the chain of aliases.
  558. X*/
  559. X
  560. Xnode *
  561. Xadd_vert(head, str)
  562. Xnode *head;
  563. Xchar *str;
  564. X{
  565. X    char *p, *malloc();
  566. X    void free();
  567. X    node *new;
  568. X
  569. X    /*
  570. X    ** strip colons off the end of alias names
  571. X    */
  572. X    if((p = index(str, ':')) != NULL) {
  573. X        *p = CNULL;
  574. X    }
  575. X    if((new = (node *) malloc(sizeof(node))) != NNULL) {
  576. X        if((new->string = malloc((unsigned) strlen(str)+1)) == NULL) {
  577. X            free(new);
  578. X            new = NNULL;
  579. X        } else {
  580. X            (void) strcpy(new->string, str);
  581. X            new->vert   = head->vert;
  582. X            new->horz   = NNULL;
  583. X            head->vert  = new;
  584. X/*DEBUG("add_vert %s->%s\n", head->string, new->string);/* */
  585. X        }
  586. X    }
  587. X    return(new);
  588. X}
  589. X
  590. X/*
  591. X** add_horz - add a (horizontal) link to the chain of recipients.
  592. X*/
  593. X
  594. Xvoid
  595. Xadd_horz(head, str)
  596. Xnode *head;
  597. Xchar *str;
  598. X{
  599. X    char *malloc();
  600. X    node *new;
  601. X
  602. X    if((new = (node *) malloc(sizeof(node))) != NNULL) {
  603. X        if((new->string = malloc((unsigned) strlen(str)+1)) == NULL) {
  604. X            free(new);
  605. X            new = NNULL;
  606. X        } else {
  607. X            (void) strcpy(new->string, str);
  608. X            new->horz  = head->horz;
  609. X            new->vert  = NNULL;
  610. X            head->horz = new;
  611. X        }
  612. X/*DEBUG("add_horz %s->%s\n", head->string, new->string);/* */
  613. X    }
  614. X}
  615. X
  616. Xnode *
  617. Xpop(head)
  618. Xnode *head;
  619. X{
  620. X    node *ret = NNULL;
  621. X
  622. X
  623. X    if(head != NNULL) {
  624. X        ret = head->horz;
  625. X        if(ret != NNULL) {
  626. X            head->horz = ret->horz;
  627. X        }
  628. X    }
  629. X    return(ret);
  630. X}
  631. END_OF_FILE
  632. if test 11011 -ne `wc -c <'mailer/alias.c'`; then
  633.     echo shar: \"'mailer/alias.c'\" unpacked with wrong size!
  634. fi
  635. # end of 'mailer/alias.c'
  636. fi
  637. if test -f 'mailer/defs.h' -a "${1}" != "-c" ; then 
  638.   echo shar: Will not clobber existing file \"'mailer/defs.h'\"
  639. else
  640. echo shar: Extracting \"'mailer/defs.h'\" \(9866 characters\)
  641. sed "s/^X//" >'mailer/defs.h' <<'END_OF_FILE'
  642. X/*
  643. X**
  644. X**  Defs.h:  header file for rmail/smail.
  645. X**
  646. X**  Configuration options for rmail/smail.
  647. X**    default configuration is:
  648. X**    full domain name is 'hostname.uucp' (get registered!)
  649. X**    path file is /usr/lib/uucp/paths.
  650. X**    no log, no record, use sendmail.
  651. X** 
  652. X**  You can change these in the next few blocks.
  653. X**
  654. X*/
  655. X
  656. X/*
  657. X**    @(#)defs.h    2.5 (smail) 9/15/87
  658. X*/
  659. X
  660. X#ifndef VERSION
  661. X#define    VERSION    "smail2.5"
  662. X#endif
  663. X
  664. X#define BSD                /* if system is a Berkeley system */
  665. X
  666. X#define SENDMAIL "/usr/lib/sendmail"    /* Turn off to use /bin/(l)mail only */
  667. X
  668. X#ifdef BSD
  669. X#define GETHOSTNAME            /* use gethostname() */
  670. X#else
  671. X#define UNAME                 /* use uname() */
  672. X#endif
  673. X
  674. X/* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  675. X/*#define HOSTNAME    "host"        /* literal name */
  676. X
  677. X/*#define HOSTDOMAIN    "host.dom"    /* overrides default HOSTNAME.MYDOM */
  678. X
  679. X/*
  680. X * .UUCP here is just for testing, GET REGISTERED in COM, EDU, etc.
  681. X * See INFO.REGISTRY for details.
  682. X */
  683. X
  684. X#define MYDOM        ".ACS.COM"        /* literal domain suffix */
  685. X
  686. X/*
  687. X * WARNING: DOMGATE is only for qualified gateways - use caution.
  688. X * If you don't fully understand it - don't use it!
  689. X * If you are not completely sure you need it - don't use it!
  690. X * If you are not prepared to handle all addresses to MYDOM - don't use it!
  691. X *
  692. X * if defined, DOMGATE (DOMain GATEway) will cause addresses of the form
  693. X *
  694. X *    user@MYDOM or MYDOM!user
  695. X *
  696. X * (with and without the leading '.' on MYDOM)
  697. X * to be seen treated simply 'user' - a purely local address.
  698. X * Then, it is left to the aliasing code to map it back to a
  699. X * non-local address if necessary.
  700. X */
  701. X
  702. X#define DOMGATE        /* Act as Domain Gateway */
  703. X
  704. X/*
  705. X * HIDDENHOSTS allows hosts that serve as domain gateways to hide
  706. X * the subdomains beneath them.  Mail that originates at any of
  707. X * the hosts in the subdomain will appear to come from the gateway host.
  708. X * Hence, mail from
  709. X *
  710. X *         anything.hostdomain!user
  711. X *
  712. X * will appear to come from 
  713. X *
  714. X *         hostdomain!user
  715. X *
  716. X * A consequence is that return mail to hostdomain!user would need to
  717. X * be forwarded to the proper subdomain via aliases or other forwarding
  718. X * facilities.
  719. X *
  720. X * If you're using sendmail, then if defined here,
  721. X * it should be used in ruleset 4 of the sendmail.cf, too.
  722. X */
  723. X
  724. X/*#define HIDDENHOSTS            /* hide subdomains of hostdomain */
  725. X
  726. X/*
  727. X * Mail that would otherwise be undeliverable will be passed to the
  728. X * aliased SMARTHOST for potential delivery.
  729. X *
  730. X * Be sure that the host you specify in your pathalias input knows that you're
  731. X * using it as a relay, or you might upset somebody when they find out some
  732. X * other way.  If you're using 'foovax' as your relay, and below you have
  733. X * #define SMARTHOST "smart-host", then the pathalias alias would be:
  734. X *
  735. X *    smart-host = foovax
  736. X */
  737. X
  738. X#define SMARTHOST  "uunet"    /* pathalias alias for relay host */
  739. X
  740. X/*
  741. X**  ALIAS and CASEALIAS are used only if SENDMAIL is NOT defined.
  742. X**  Sites using sendmail have to let sendmail do the aliasing.
  743. X**  LOWERLOGNAME maps all local login names into lower case.  This
  744. X**  helps sites who have only upper case send mail to mixed case sites.
  745. X*/
  746. X
  747. X/*#define ALIAS    "/usr/lib/aliases"    /* location of mail aliases       */
  748. X/*#define CASEALIAS            /* make aliases case sensitive    */
  749. X/*#define LOWERLOGNAME            /* map local logins to lower case */
  750. X
  751. X/*
  752. X * defining FULLNAME means that Full Name resolution
  753. X * will be attempted when necessary.
  754. X *
  755. X * the Full Name information will be taken from a
  756. X * list of {Full Name, address} pairs.
  757. X * The names in the list must be sorted
  758. X * without regard to upper/lower case.
  759. X *
  760. X * defining DOT_REQD says that the user name must contain a '.' for
  761. X * the Full Name search to be done.
  762. X *
  763. X * All full name searches are case insensitive.
  764. X *
  765. X */
  766. X
  767. X/*#define FULLNAME    "/usr/lib/fullnames"
  768. X                    /* list of Full Name, address pairs */
  769. X
  770. X/*#define DOT_REQD            /* Must be George.P.Burdell@gatech.EDU
  771. X                    ** not just  Burdell@gatech.EDU
  772. X                    */
  773. X
  774. X/*
  775. X**    PATHS is name of pathalias file.  This is mandatory.
  776. X**    Define LOG if you want a log of mail.  This can be handy for
  777. X**    debugging and traffic analysis.
  778. X**    Define RECORD for a copy of all mail.  This uses much time and
  779. X**    space and is only used for extreme debugging cases.
  780. X*/
  781. X
  782. X#ifndef PATHS
  783. X#define PATHS    "/usr/lib/uucp/paths"    /* location of the path database */
  784. X#endif
  785. X
  786. X#define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  787. X/*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  788. X
  789. X/*
  790. X**  Mailer options:
  791. X**    RMAIL is the command to invoke rmail on machine sys.
  792. X**    RARG is how to insulate metacharacters from RMAIL. 
  793. X**    LMAIL is the command to invoke the local mail transfer agent.
  794. X**    LARG is how to insulate metacharacters from LMAIL. 
  795. X**    RLARG is LARG with host! on the front - to pass a uux addr to sendmail.
  796. X**    SENDMAIL selects one of two sets of defines below for either
  797. X**    using sendmail or /bin/lmail.
  798. X*/    
  799. X
  800. X#ifndef UUX
  801. X#define UUX        "/usr/bin/uux"    /* location of uux command   */
  802. X#endif
  803. X
  804. X#ifndef SMAIL
  805. X#define SMAIL        "/bin/smail"    /* location of smail command */
  806. X#endif
  807. X
  808. X/*
  809. X** command used to retry failed mail, flag is used to set the routing level.
  810. X*/
  811. X#define VFLAG        ((debug == VERBOSE)?"-v":"")
  812. X#define RETRY(flag)    "%s %s %s -f %s ", SMAIL, VFLAG, flag, spoolfile
  813. X
  814. X/*
  815. X** use the -a if you have it.  This sometimes helps failed mail and warning
  816. X** messages get back to where the mail originated.
  817. X**
  818. X** some versions of uux can't do '-a' - pick one of the next two definitions
  819. X*/
  820. X
  821. X/*#define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  822. X#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  823. X
  824. X#define RARG(user)        " '(%s)'",user
  825. X/*
  826. X#ifdef ACSMAIL
  827. X#define RFROM(frm,now,host)     "From anonymous  %.24s remote from %s\n",now,host
  828. X#else
  829. X#define RFROM(frm,now,host)     "From %s  %.24s remote from %s\n",frm,now,host
  830. X#endif
  831. X*/
  832. X#define RFROM(frm,now,host)     "From %s  %.24s remote from %s\n",frm,now,host
  833. X#ifdef SENDMAIL
  834. X
  835. X#define HANDLE    JUSTUUCP    /* see HANDLE definition below */
  836. X#define ROUTING JUSTDOMAIN    /* see ROUTING definition below */
  837. X
  838. X#define LMAIL(frm,sys)     "%s -em -f%s",SENDMAIL,frm
  839. X#define LARG(user)        " '%s'",postmaster(user)
  840. X#define RLARG(sys,frm)        " '%s!%s'",sys,frm
  841. X#define LFROM(frm,now,host)    "From %s %.24s\n",frm,now
  842. X
  843. X#else
  844. X
  845. X#define HANDLE    ALL
  846. X#define ROUTING JUSTDOMAIN
  847. X
  848. X#ifdef BSD
  849. X#define LMAIL(frm,sys)        "/bin/mail"    /* BSD local delivery agent */
  850. X#else
  851. X#define LMAIL(frm,sys)        "/bin/lmail"    /* SV  local delivery agent */
  852. X#endif
  853. X
  854. X#define LARG(user)        " '%s'",postmaster(user)
  855. X#define RLARG(sys,frm)        " '%s!%s'",sys,frm
  856. X#define LFROM(frm,now,host)    "From %s %.24s\n",frm,now
  857. X
  858. X#endif
  859. X
  860. X/*
  861. X**    The following definitions affect the queueing algorithm for uux.
  862. X**
  863. X**    DEFQUEUE    if defined the default is to queue uux mail
  864. X**
  865. X**    QUEUECOST    remote mail with a cost of less than QUEUECOST
  866. X**            will be handed to uux for immediate delivery.
  867. X**
  868. X**    MAXNOQUEUE    don't allow more than 'n' immediate delivery
  869. X**            jobs to be started on a single invocation of smail.
  870. X**    
  871. X**    GETCOST        if defined, the paths file will be searched for
  872. X**            each address to discover the cost of the route.
  873. X**            this allows informed decisions about whether to
  874. X**            use the queue flags when calling uux.  The price
  875. X**            is in the overhead of a paths file search for
  876. X**            addresses that are not going to be routed.
  877. X*/
  878. X
  879. X#define DEFQUEUE            /* default is to queue uux jobs */
  880. X
  881. X#define QUEUECOST        100    /* deliver immediately if the cost
  882. X                    /* is DEDICATED+LOW or better */
  883. X
  884. X#define MAXNOQUEUE        2    /* max UUX_NOQUEUE jobs         */
  885. X
  886. X#define GETCOST                /* search for cost        */
  887. X
  888. X#define UUX_QUEUE        "-r"    /* uux flag for queueing    */
  889. X#define UUX_NOQUEUE        ""    /* uux with immediate delivery    */
  890. X
  891. X/*
  892. X** Normally, all mail destined for the local host is delivered with a single
  893. X** call to the local mailer, and all remote mail is delivered with one call
  894. X** to the remote mailer for each remote host.  This kind of 'batching' saves
  895. X** on the cpu overhead.
  896. X**
  897. X** MAXCLEN is used to limit the length of commands that are exec'd by smail.
  898. X** This is done to keep other program's buffers from overflowing, or to
  899. X** allow for less intelligent commands which can take only one argument
  900. X** at a time (e.g., 4.1 /bin/mail).  To disable the batching, set MAXCLEN
  901. X** a small value (like 0).
  902. X*/
  903. X
  904. X#define MAXCLEN            128    /* longest command allowed (approx.)
  905. X                    /* this is to keep other's buffers
  906. X                    ** from overflowing
  907. X                    */
  908. X
  909. X/*
  910. X** PLEASE DON'T TOUCH THE REST
  911. X*/
  912. X
  913. X#define SMLBUF    512    /* small buffer (handle one item) */
  914. X#define BIGBUF    4096    /* handle lots of items */
  915. X#define MAXPATH    32    /* number of elements in ! path */
  916. X#define MAXDOMS    16    /* number of subdomains in . domain */
  917. X#define MAXARGS    500    /* number of arguments */
  918. X#ifndef NULL
  919. X#define NULL    0
  920. X#endif
  921. X
  922. X#define DEBUG         if (debug==YES) (void) printf
  923. X#define ADVISE         if (debug!=NO) (void) printf
  924. X#define error(stat,msg,a)    { (void) fprintf(stderr, msg, a); exit(stat); }
  925. X#define lower(c)         ( isupper(c) ? c-'A'+'a' : c )
  926. X
  927. X
  928. Xenum eform {    /* format of addresses */
  929. X    ERROR,         /* bad or invalidated format */
  930. X    LOCAL,         /* just a local name */
  931. X    DOMAIN,     /* user@domain or domain!user */
  932. X    UUCP,        /* host!address */
  933. X    ROUTE,        /* intermediate form - to be routed */
  934. X    SENT        /* sent to a mailer on a previous pass */
  935. X};
  936. X
  937. Xenum ehandle {     /* what addresses can we handle? (don't kick to LMAIL) */
  938. X    ALL,        /* UUCP and DOMAIN addresses */
  939. X    JUSTUUCP,    /* UUCP only; set by -l  */
  940. X    NONE        /* all mail is LOCAL; set by -L */
  941. X};
  942. X
  943. Xenum erouting {    /* when to route A!B!C!D */
  944. X    JUSTDOMAIN,    /* route A if A is a domain */
  945. X    ALWAYS,        /* route A always; set by -r */
  946. X    REROUTE        /* route C, B, or A (whichever works); set by -R */
  947. X};
  948. X
  949. Xenum edebug {    /* debug modes */
  950. X    NO,        /* normal deliver */
  951. X    VERBOSE,    /* talk alot */
  952. X    YES        /* talk and don't deliver */
  953. X};
  954. X
  955. X#ifdef BSD
  956. X
  957. X#include <strings.h>
  958. X#include <sysexits.h>
  959. X
  960. X#else
  961. X
  962. X#include <string.h>
  963. X#include "sysexits.h"
  964. X#define    index    strchr
  965. X#define    rindex    strrchr
  966. X
  967. X#endif
  968. Xextern void exit(), perror();
  969. Xextern unsigned sleep();
  970. END_OF_FILE
  971. if test 9866 -ne `wc -c <'mailer/defs.h'`; then
  972.     echo shar: \"'mailer/defs.h'\" unpacked with wrong size!
  973. fi
  974. # end of 'mailer/defs.h'
  975. fi
  976. if test -f 'mailer/smail.8' -a "${1}" != "-c" ; then 
  977.   echo shar: Will not clobber existing file \"'mailer/smail.8'\"
  978. else
  979. echo shar: Extracting \"'mailer/smail.8'\" \(10111 characters\)
  980. sed "s/^X//" >'mailer/smail.8' <<'END_OF_FILE'
  981. X.TH SMAIL 8
  982. X.SH NAME
  983. Xsmail, rmail \- UUCP mailer with routing
  984. X.SH SYNOPSIS
  985. X.B smail
  986. X[ options ] address ...
  987. X.br
  988. X.B rmail
  989. X[ options ] address ...
  990. X.SH DESCRIPTION
  991. XThe
  992. X.I smail/rmail
  993. Xprogram replaces
  994. X.IR /bin/rmail (1)
  995. Xto become the UUCP mail transport mechanism.
  996. XThey are links to the same executable.
  997. X.I rmail
  998. Xreceives mail from UUCP,
  999. X.I smail
  1000. Xintroduces mail into UUCP.
  1001. X.PP
  1002. X.I smail/rmail
  1003. Xcan work with or without
  1004. X.IR sendmail (8),
  1005. Xor another intelligent mail system.
  1006. XFor hosts with just
  1007. X.IR /bin/mail (1),
  1008. X.I smail/rmail
  1009. Xsubsumes some of the functions of
  1010. X.I sendmail,
  1011. Xand hands only local mail to
  1012. X.I /bin/mail.
  1013. XFor hosts with
  1014. X.I sendmail,
  1015. X.I smail/rmail
  1016. Xcan act as UUCP front and back ends to
  1017. X.I sendmail,
  1018. Xallowing
  1019. X.I sendmail
  1020. Xto process all mail through the host.
  1021. XAs distributed, 'bang' mail that is not bound for a local
  1022. Xrecipient will be passed directly to
  1023. X.I uux
  1024. Xwithout calling
  1025. X.I sendmail.
  1026. X.PP
  1027. XTo varying degrees,
  1028. X.I smail/rmail
  1029. Xautomatically routes the addresses it processes.
  1030. X.I smail/rmail
  1031. Xmost often routes domain style addresses (i.e. user@domain), producing
  1032. Xa UUCP path (i.e. host!address) or a local address (i.e. user), but it can
  1033. Xalso reroute explicit UUCP paths.
  1034. X.SH OPTIONS
  1035. X.TP
  1036. X.B \-A
  1037. XPrint the resolved addresses.  Don't collect a message or invoke a mailer.
  1038. X.TP
  1039. X.B \-d
  1040. XBe verbose and don't invoke other mailers.
  1041. X.TP
  1042. X.B \-v
  1043. XBe verbose, but still invoke other mailers.
  1044. X.TP
  1045. X.BI \-h " hostname"
  1046. XSet hostname.  The default is configuration dependent, but usually provided
  1047. Xby a system call such as
  1048. X.IR gethostname (2)
  1049. Xor
  1050. X.IR uname (2).
  1051. X.TP
  1052. X.BI \-H " hostdomain"
  1053. Xset hostdomain.  The default is configuration dependent.
  1054. X.TP
  1055. X.BI \-F " address"
  1056. Xuse
  1057. X.I address
  1058. Xon the From: line in locally generated mail.
  1059. X.TP
  1060. X.BI \-p " pathfile"
  1061. XSet path database file name if not /usr/lib/uucp/paths.
  1062. X.TP
  1063. X.BI \-a " aliasfile"
  1064. XFor sites without sendmail, set alias database file name if not in
  1065. Xthe place defined at compile time (see ALIASES in defs.h).
  1066. XThis is usually
  1067. X.I /usr/lib/aliases
  1068. X.TP
  1069. X.BI \-n " namelist"
  1070. X.I smail
  1071. Xsupports another type of aliasing intended for full name resolution
  1072. Xusing a sorted file,
  1073. X.I namelist,
  1074. Xof name/address pairs.
  1075. XThis allows mail to George.P.Burdell@gatech.edu to be delivered
  1076. Xappropriately.  These aliases are by their nature very simple
  1077. Xsince they are not composed of long lists of recipients for each alias.
  1078. XThey are also numerous, since mail to George.P.Burdell may be addressed
  1079. Xto Burdell, G.Burdell, George.Burdell, P.Burdell, G.P.Burdell, or
  1080. XGeorge.P.Burdell.  This simpler form of aliasing uses the same
  1081. Xfast searching algorithm that is used for the paths file, so
  1082. Xit keeps resolution time manageable.
  1083. X.TP
  1084. X.BI \-q " number"
  1085. XTake
  1086. X.I number
  1087. Xas the queueing threshold.
  1088. XWhen routing mail (
  1089. X.I -r, -R,
  1090. Xor domain addressed mail
  1091. X) to a given host, if the cost listed in the
  1092. X.I paths
  1093. Xfile is less than the queueing threshold, then the mail
  1094. Xwill be sent immediately.  This overrides the default threshold
  1095. X(see QUEUECOST in defs.h) of DEDICATED+LOW.
  1096. X.TP
  1097. X.BI \-m " number"
  1098. XAt most 
  1099. X.I number
  1100. Xjobs will be handed to uux for immediate delivery
  1101. Xby a single invocation of
  1102. X.I smail
  1103. X(see MAXNOQUEUE in defs.h).
  1104. X.TP
  1105. X.BI \-u " uuxflags"
  1106. XUse
  1107. X.I uuxflags
  1108. Xas the flags passed to uux for remote mail.
  1109. XThis overrides any of the default values and other queueing strategies.
  1110. X.TP
  1111. X.B -c
  1112. XConsult the paths file for the cost of the path even when not routing
  1113. Xthe mail.  This makes it possible to use the cost information when
  1114. Xsending pure UUCP path mail without rerouting it.
  1115. X.TP
  1116. X.B \-r
  1117. XRoute the first component of a UUCP path (host!address) in addition to routing
  1118. Xdomain addresses (user@domain).
  1119. X.TP
  1120. X.B \-R
  1121. XReroute UUCP paths, trying successively larger righthand substrings
  1122. Xof a path until a component is recognized.
  1123. X.TP
  1124. X.B \-l
  1125. XInstead of routing a domain address, send it to the local mailer for
  1126. Xprocessing.  Normally, only local addresses go to the local mailer.
  1127. X.TP
  1128. X.B \-L
  1129. XSend all addresses to the local mailer for processing, including UUCP paths.
  1130. X.PP
  1131. XMost of the flags are also compile time options, since
  1132. X.I uux
  1133. Xdoes not normally invoke
  1134. X.I rmail
  1135. Xwith the desired flags.
  1136. X.I smail
  1137. Xresets any preset
  1138. X.B -l
  1139. Xor
  1140. X.B -L
  1141. Xflags.
  1142. X.B -l
  1143. Xflag causes 
  1144. X.B rmail
  1145. Xto send all domain addresses through the local mailer,
  1146. Xto process addresses for non UUCP domains.
  1147. XThe
  1148. X.B -L
  1149. Xflag causes
  1150. X.B rmail
  1151. Xto send even explicit UUCP paths through the local mailer,
  1152. Xpresumably to make use of other transport mechanisms.
  1153. XIn both cases, rmail defers any routing until smail gets hold it.
  1154. X.SH ADDRESSES
  1155. X.I smail/rmail
  1156. Xunderstands "user@domain" to be a domain address, "host!address" to be a
  1157. XUUCP path, and anything else to be a local address.
  1158. X.PP
  1159. XBecause hostile
  1160. X.I rmail's
  1161. Xunpredictably interpret mixed UUCP/domain addresses,
  1162. X.I smail/rmail
  1163. Xunderstands "domain!user" to be a domain address, and generates
  1164. X"path!domain!user" when mailing to a cognate
  1165. X.I smail/rmail
  1166. Xhost.
  1167. XTo distinguish domain "domain!user" from UUCP "host!address", "domain"
  1168. Xcontains at least one (1) period.
  1169. XUnlike the old
  1170. X.I /bin/rmail,
  1171. X.I smail/rmail
  1172. Xgives precedence to @ over ! when parsing mixed addresses,
  1173. Xthus a!b@c is parsed as (a!b)@c, rather than a!(b@c).
  1174. X.SH ROUTING
  1175. XBecause
  1176. X.I smail/rmail
  1177. Xis the UUCP transport mechanism, it can only effect delivery on UUCP paths 
  1178. Xand local addresses; domain addresses require resolution into UUCP paths or
  1179. Xlocal addresses.  
  1180. XTo resolve a domain address,
  1181. X.I smail/rmail
  1182. Xfinds a route to the most specific part of the domain specification listed
  1183. Xin the routing table.
  1184. XTwo degrees of resolution can occur:
  1185. X.RS
  1186. X.PP
  1187. XFull resolution:
  1188. X.I smail/rmail
  1189. Xfinds a route for the entire domain specification, and tacks the user
  1190. Xspecification onto the end of the UUCP path.
  1191. XThe address can also fully resolve to a local address (the UUCP path is null).
  1192. X.PP
  1193. XPartial resolution:
  1194. X.I smail/rmail
  1195. Xfinds a route for only righthand part of the domain specification, so it 
  1196. Xtacks the complete address (in the form domain!user) onto the end of the 
  1197. XUUCP path.
  1198. XSince this syntax is not widely understood, UUCP gateways listed in
  1199. Xthe path database must install new UUCP software, either
  1200. X.I smail/rmail
  1201. Xor new
  1202. X.I sendmail
  1203. Xconfiguration files (or both).
  1204. X.RE
  1205. X.PP
  1206. XIt is an error if a partially resolved address routes to the local host 
  1207. X(a null UUCP path), since according to the routing table, the local
  1208. Xhost is responsible for resolving the address more fully.
  1209. X.PP
  1210. XThe
  1211. X.B -r
  1212. Xflag causes
  1213. X.I smail/rmail
  1214. Xto attempt to route the first component of a UUCP path, probably so it
  1215. Xcan impress people with how many UUCP hosts it knows.
  1216. XIf this fails, it passes the unrouted address to
  1217. X.I uux,
  1218. Xin case the path database is not complete.
  1219. XThe 
  1220. X.B -R
  1221. Xflag causes
  1222. X.I smail/rmail
  1223. Xto take a UUCP path and route the rightmost component of the path (save
  1224. Xthe user name) possible.
  1225. XThis is mostly for hosts that have very up-to-date routing tables.
  1226. X.PP
  1227. XIf a route cannot be discerned from the available routing database,
  1228. Xthen one more attempt to route the mail is made by searching for an
  1229. Xentry in the database for a route to a
  1230. X.I smart-host.
  1231. XIf this entry exists, then the mail will be forwarded along that route
  1232. Xto be delivered.  This allows a host to depend on another, presumably
  1233. Xbetter informed, host for delivering its mail.
  1234. XThis kind of arrangement should be worked out,
  1235. X.I in advance,
  1236. Xwith the
  1237. X.IR smart-host 's
  1238. Xadministrator.
  1239. X.PP
  1240. XAfter
  1241. X.I smail/rmail
  1242. Xresolves an address, it reparses it to see if it is now a UUCP path or
  1243. Xlocal address.  If the new address turns out to be another
  1244. Xdomain address, smail complains because we don't like to resolve more than once.
  1245. XThis error occurs when an address partially resolves the local host.
  1246. X.PP
  1247. XBy default,
  1248. X.I smail
  1249. Xwill not alter the explicit bang path routing of any mail message.
  1250. XIf the stated path is unuseable, (i.e., the next hop host is unknown)
  1251. Xthen smail will apply ALWAYS routing, and attempt to deliver the mail
  1252. Xto the potentially new address.  If this fails too, then REROUTE routing
  1253. Xwill be applied to the address, and another attempt to deliver is made.
  1254. XLastly, an attempt to find a path to a better informed host
  1255. X.I smart-host
  1256. Xwill be made and the mail passed to that host.
  1257. X.SH FROMMING
  1258. X.I smail/rmail
  1259. Xcollapses From_ and >From_ lines to generate a simple from argument, which
  1260. Xit can pass to
  1261. X.I sendmail
  1262. Xor use to create its own "From" line.
  1263. XThe rule for fromming is: concatenate each "remote from" host (separating 
  1264. Xthem by !'s), and tack on the address on the last From_ line; if that address 
  1265. Xis in user@domain format, rewrite it as domain!user; ignore host or
  1266. Xdomain if either is simply the local hostname.  It also removes redundant
  1267. Xinformation from the From_ line.  For instance:
  1268. X.sp
  1269. X.ce
  1270. X ...!myhost!myhost.mydomain!...
  1271. X.sp
  1272. Xbecomes
  1273. X.sp
  1274. X.ce
  1275. X ...!myhost!...
  1276. X.sp
  1277. XLeading occurrences of the local host name are elided as well.
  1278. X.PP
  1279. X.I smail/rmail
  1280. Xgenerates it own From_ line, unless it is feeding
  1281. X.I sendmail,
  1282. Xwhich is happy with the
  1283. X.BI -f from
  1284. Xargument.
  1285. XFor UUCP bound mail,
  1286. X.I smail/rmail
  1287. Xgenerates a "remote from hostname", where hostname is the UUCP hostname
  1288. X(not the domain name), so that From_ can indicate a valid UUCP path, leaving
  1289. Xthe sender's domain address in From:.
  1290. X.SH HEADERS
  1291. XCertain headers, To:, From:, Date, etc., are required by RFC822.
  1292. XIf these headers are absent in locally generated mail, they will
  1293. Xbe inserted by smail.  Also, a line of trace information, called
  1294. Xa Received: line, will be inserted at the top of each message.
  1295. X.SH UNDELIVERABLE MAIL"
  1296. XAlthough nobody likes to have a mail message fail to reach its
  1297. Xintended destination, it somtimes happens that way.
  1298. XMail that is found to be undeliverable
  1299. X(i.e., unknown user or unknown host)
  1300. Xwill be returned to the sender.
  1301. X.SH FILES
  1302. X/usr/lib/uucp/paths        ascii path database
  1303. X.br
  1304. X/usr/lib/aliases        ascii alias database
  1305. X.br
  1306. X/usr/spool/uucp/mail.log        log of mail
  1307. X.br
  1308. X/tmp/mail.log            record of mail
  1309. X.SH SUPPORT
  1310. XEnhancements, enhancement requests, trouble reports, etc.,
  1311. Xshould be sent to
  1312. X.sp
  1313. X.ce
  1314. Xuucp-problem@Stargate.COM.
  1315. X.sp
  1316. X.SH "SEE ALSO"
  1317. X.IR uux (1),
  1318. X.IR paths (8),
  1319. X.IR aliases (8)
  1320. X.br
  1321. X.IR sendmail (8)
  1322. X.br
  1323. X.IR binmail (1)
  1324. Xon BSD systems only
  1325. X.br
  1326. X.IR mail (1)
  1327. Xon System V systems
  1328. X.SH VERSION
  1329. X@(#)smail.8    2.5 (smail) 9/15/87
  1330. END_OF_FILE
  1331. if test 10111 -ne `wc -c <'mailer/smail.8'`; then
  1332.     echo shar: \"'mailer/smail.8'\" unpacked with wrong size!
  1333. fi
  1334. # end of 'mailer/smail.8'
  1335. fi
  1336. echo shar: End of archive 6 \(of 8\).
  1337. cp /dev/null ark6isdone
  1338. MISSING=""
  1339. for I in 1 2 3 4 5 6 7 8 ; do
  1340.     if test ! -f ark${I}isdone ; then
  1341.     MISSING="${MISSING} ${I}"
  1342.     fi
  1343. done
  1344. if test "${MISSING}" = "" ; then
  1345.     echo You have unpacked all 8 archives.
  1346.     rm -f ark[1-9]isdone
  1347. else
  1348.     echo You still need to unpack the following archives:
  1349.     echo "        " ${MISSING}
  1350. fi
  1351. ##  End of shell archive.
  1352. exit 0
  1353.