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

  1. From: csu@alembic.acs.com (Dave Mack)
  2. Newsgroups: alt.sources
  3. Subject: Anonymous Contact Service software v1.1, Part04/08
  4. Message-ID: <1990Jul15.170802.6970@alembic.acs.com>
  5. Date: 15 Jul 90 17:08:02 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 4 (of 8)."
  31. # Contents:  mailer/Read.Me mailer/resolve.c mailer/template.cf
  32. # Wrapped by csu@alembic on Sun Jul 15 12:46:48 1990
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'mailer/Read.Me' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'mailer/Read.Me'\"
  36. else
  37. echo shar: Extracting \"'mailer/Read.Me'\" \(6735 characters\)
  38. sed "s/^X//" >'mailer/Read.Me' <<'END_OF_FILE'
  39. X        Read.Me - Updated 9/15/87
  40. X
  41. XWhat smail does:
  42. X
  43. X  smail is capable of handling UUCP syntax (bang paths, bang
  44. X  domains, and at domains are supported) mail transportation
  45. X  over UUCP/uux/rmail channels.  It will support machines that
  46. X  only have UUCP connections, and machines with UUCP links to
  47. X  the outside world plus a small number of local machines that
  48. X  are reached via SMTP.  The domain intelligence is embedded
  49. X  in the smail database (e.g. the pathalias output), not the
  50. X  sendmail.cf file, so if you have a fancier domain structure
  51. X  that involves SMTP or anything other than uux in the domain
  52. X  structure, you'll want to modify the sendmail.cf file here or
  53. X  merge pieces of the enclosed sendmail.cf into your own.
  54. X
  55. X  smail runs under 4.2BSD and System V, as a back end to sendmail;
  56. X  and under System V without sendmail.  It also replaces rmail, which
  57. X  becomes a link to smail.  In a sendmail environment, smail depends on
  58. X  sendmail to crack the headers, as smail just deals with the envelope.
  59. X  smail makes your host capable of using the INTERNET definition in the
  60. X  Usenet software.
  61. X
  62. X  Features of smail include:
  63. X
  64. X  (1) Using pathalias data to choose the best route to your destination.
  65. X  (2) Handling of user@domain, domain!user, and host!user syntax.
  66. X  (3) Generation of domain!user syntax to be forwarded by other systems.
  67. X  (4) Logging of traffic through your machine, by sender, recipient, and
  68. X      size of message, so you can, track use and detect abuse of your
  69. X      machine.
  70. X  (5) Mail being forwarded through your machine to another uux link is
  71. X      passed from rmail directly to uux, so there's less overhead on
  72. X      your machine (sendmail stays out of the loop.)
  73. X  (6) Sendmail-like alias capability for hosts without sendmail.
  74. X  (7) Generation of RFC822 required headers for locally generated mail.
  75. X  (8) Robust delivery scheme that reroutes only if stated path is inaccessible.
  76. X  (8) Mail that is undeliverable is returned to sender.
  77. X  (9) Simplicity.
  78. X
  79. XPrerequisites:
  80. X
  81. X  A copy of a recent posting of pathalias.  (The one posted
  82. X  by Peter Honeyman in January 1986 is recommended.)
  83. X
  84. X  A current copy of the UUCP map, or at least a copy of the
  85. X  appropriate part of it that you're interested in.
  86. X
  87. X  A properly registered domain name for your organization, such
  88. X  as ATT.COM.  (It is possible to run smail using a domain name
  89. X  under .UUCP, but since this can't be officially registered,
  90. X  it is appropriate only for testing.)
  91. X
  92. X  You can get pathalias from the mod.sources Usenet archive
  93. X  (contact sources-request@uunet.uu.net or uunet!sources-request)
  94. X
  95. X  You can get a UUCP map each month from Usenet newsgroup mod.map.
  96. X  The UUCP map is quite large (currently about 2MB) so please don't ask
  97. X  to have a copy mailed to you - get a copy from a nearby Usenet site.
  98. X
  99. X  You can get a domain name by joining the UUCP Zone.  There are
  100. X  low membership dues for this, and a registration process that
  101. X  will take 2-8 weeks.  This Read.Me file may be out of date by
  102. X  the time you read it, so we ask you to contact us for current
  103. X  dues rates and procedures.  Contact uucp-query@Stargate.COM or
  104. X  cbosgd!stargate!uucp-query and ask for the UUCP Zone information
  105. X  packet.  (If you already belong to a network such as CSNET, DDN,
  106. X  or BITNET, your organization may already have a domain name.  If
  107. X  you are also on UUCP, it is recommended that you also join the
  108. X  UUCP Zone at the lower rate for organizations whose primary
  109. X  affiliation is with another network.  See the file "Registry"
  110. X  for more information.
  111. X
  112. XOverall structure:
  113. X
  114. X  smail is installed in /bin/smail with a link in /bin/rmail.  Uuxqt
  115. X  calls rmail, which either forwards the message on to the next hop
  116. X  directly or, on a sysetm with sendmail, calls sendmail.  sendmail
  117. X  may decide the message should be delivered by UUCP, and invoke smail,
  118. X  which will look up a route and invoke uux.  (Note that the choice
  119. X  about when to invoke sendmail and when to process a message directly
  120. X  can be configured in smail.)
  121. X
  122. X  smail uses a database which is generated from pathalias.  You take the
  123. X  current UUCP map, add some local information and topology data (to tell
  124. X  it about the domain tree) and run pathalias.  The result is sorted and
  125. X  installed in /usr/lib/uucp/paths.  There is no hashing done on this
  126. X  file - when smail looks up a name it uses a binary search.
  127. X
  128. XConfiguration considerations:
  129. X
  130. X  You'll note two configuration options in defs.h: HANDLE and ROUTING.
  131. X  These control which sorts of addresses smail/rmail will handle, and
  132. X  which type of routing they will do.  The HANDLE define only affects
  133. X  rmail, since smail sets it implicitly.  In any case, we recommend
  134. X  that you leave HANDLE alone, unless you are making major changes.
  135. X
  136. X  ROUTING has three choices: JUSTDOMAIN, ALWAYS, and REROUTE.  rmail
  137. X  will run as JUSTDOMAIN, the defs.h default.  This means rmail will
  138. X  only apply routing if it sees "rmail user@domain", and will just call
  139. X  uux if it sees "rmail host!user".  (If the uux fails, it will call
  140. X  smail -r, which will apply ALWAYS routing to try to get the mail
  141. X  there anyway.  If the ALWAYS routing fails, then REROUTE routing is
  142. X  applied.  This has the advantage of being low overhead on your
  143. X  system, not second guessing a route someone else asked for, and still
  144. X  recovering nicely from the mistakes of another system.  Your host
  145. X  becomes a "smart host" that can get mail anywhere.)
  146. X
  147. X  Many people will note huge paths going through their machine.  These
  148. X  paths are generated by replies to netnews messages, and tend to be 10
  149. X  or 20 hops long - far longer than necessary.  If you are a bit aggressive,
  150. X  you can change -r to -R, which will cause such failed mail to be rerouted,
  151. X  thus, mail to a!b!c!d!e!f!g!user will look up a route to g, and send the
  152. X  mail to route!g!user.  (If it can't find g, it will try f, then e, and
  153. X  so on until it finds someone it recognizes.)  If you are REALLY aggressive,
  154. X  you can change ROUTING to REROUTE in defs.h, to get the same effect for
  155. X  ALL rmail being passed through your machine.  This may help cut phone
  156. X  bills, but it has some disadvantages.  It can lengthen a path sometimes,
  157. X  e.g. mail to tektronix!user might turn into ihnp4!tektronix!user if your
  158. X  routing database says mail to tektronix goes through ihnp4.  It makes it
  159. X  hard to route around a dead host, or to redirect traffic from a mailing
  160. X  list to several different directions.  It may also make mail go a different
  161. X  path than what your user thought it was, and it affects other hosts that
  162. X  route mail through you if you set ROUTING to REROUTE in defs.h.  So only
  163. X  do this if you know what you are doing, and are willing to live with the
  164. X  disadvantages.
  165. X
  166. X#
  167. X#@(#)Read.Me    2.5 (smail) 9/15/87
  168. X#
  169. END_OF_FILE
  170. if test 6735 -ne `wc -c <'mailer/Read.Me'`; then
  171.     echo shar: \"'mailer/Read.Me'\" unpacked with wrong size!
  172. fi
  173. # end of 'mailer/Read.Me'
  174. fi
  175. if test -f 'mailer/resolve.c' -a "${1}" != "-c" ; then 
  176.   echo shar: Will not clobber existing file \"'mailer/resolve.c'\"
  177. else
  178. echo shar: Extracting \"'mailer/resolve.c'\" \(7634 characters\)
  179. sed "s/^X//" >'mailer/resolve.c' <<'END_OF_FILE'
  180. X/*
  181. X**
  182. X**  Resolve.c
  183. X**
  184. X**  Routes then resolves addresses into UUCP or LOCAL.
  185. X**
  186. X*/
  187. X#ifndef lint
  188. Xstatic char     *sccsid="@(#)resolve.c    2.5 (smail) 9/15/87";
  189. X#endif
  190. X
  191. X#include    <ctype.h>
  192. X#include    <stdio.h>
  193. X#include    "defs.h"
  194. X
  195. Xextern int exitstat;        /* set if address doesn't resolve     */
  196. Xextern enum ehandle handle;    /* what mail we can handle        */
  197. Xextern enum edebug debug;    /* verbose and debug modes        */
  198. Xextern enum erouting routing;    /* when to route addresses        */
  199. Xextern char hostdomain[];    /* */
  200. Xextern char hostname[];        /* */
  201. Xextern char *pathfile;        /* location of path database        */
  202. Xextern int getcost;        /* get path cost even if not routing    */
  203. X
  204. Xchar *sform();
  205. X
  206. X/*
  207. X**
  208. X**  rsvp(): how to resolve addresses.
  209. X**
  210. X**  After parsing an address into <form>, the resolved form will be
  211. X**  rsvp( form ).  If == ROUTE, we route the parsed address and parse again.
  212. X**
  213. X*/
  214. X
  215. X# define rsvp(a) table[(int)a][(int)handle]
  216. X
  217. Xenum eform table[5][3] = {
  218. X/*    all        justuucp    none */
  219. X{    ERROR,         ERROR,         ERROR },     /* error */
  220. X{    LOCAL,         LOCAL,         LOCAL },     /* local */
  221. X{    ROUTE,         LOCAL,         LOCAL },     /* domain */
  222. X{    UUCP,         UUCP,         LOCAL },     /* uucp */
  223. X{    ERROR,         ERROR,         ERROR }};    /* route */
  224. X
  225. X/*
  226. X**
  227. X**  resolve(): resolve addresses to <host, user, form>.
  228. X**
  229. X**  This is a gnarly piece of code, but it does it all.  Each section 
  230. X**  is documented.
  231. X**
  232. X*/
  233. X
  234. Xenum eform
  235. Xresolve( address, domain, user , cost)
  236. Xchar *address;                /* the input address     */
  237. Xchar *domain;                /* the returned domain     */
  238. Xchar *user;                /* the returned user     */
  239. Xint *cost;                /* the returned cost     */
  240. X{
  241. X    enum eform form;        /* the returned form    */ 
  242. X    enum eform parse();        /* to crack addresses    */
  243. X    int parts;            /* to ssplit addresses    */
  244. X    char *partv[MAXPATH];        /* "  "      "        */
  245. X    char temp[SMLBUF];        /* "  "      "        */
  246. X    int i;
  247. X        
  248. X
  249. X/*
  250. X**  If we set REROUTE and are prepared to deliver UUCP mail, we split the 
  251. X**  address apart at !'s and try to resolve successively larger righthand 
  252. X**  substrings until we succeed.  Otherwise, we just resolve the whole thing 
  253. X**  once.
  254. X*/
  255. X    if ((routing == REROUTE) && (rsvp( UUCP ) == UUCP)) {
  256. X        parts = ssplit( address, '!', partv );
  257. X    } else {
  258. X        parts = 1;
  259. X        partv[0] = address;
  260. X    }
  261. X/*
  262. X**  This for(i) loop selects successively larger
  263. X**  righthand substrings of the address.
  264. X*/
  265. X    for( i = parts - 1; i >= 0; i-- ) {
  266. X/*
  267. X**  Parse the address.
  268. X*/
  269. X        (void) strcpy( temp, partv[i] );
  270. X        form = parse( temp, domain, user );
  271. X
  272. XDEBUG("resolve: parse address '%s' = '%s' @ '%s' (%s)\n",
  273. X    temp,user,domain,sform(form));
  274. X
  275. X/*
  276. X**  If we are looking at a substring (that's not the entire string)
  277. X**  which parses to a LOCAL address, we skip to the next larger substring.
  278. X*/
  279. X        if((i != 0) && (form == LOCAL))
  280. X            continue;
  281. X/*
  282. X**  Routing, when required, is the next step.
  283. X**  We route the address if we have a ROUTE form
  284. X**  or if we have a UUCP form and we are told to
  285. X**  route ALWAYS or REROUTE (i.e., routing != JUSTDOMAIN)
  286. X*/
  287. X        if((rsvp( form ) == ROUTE)
  288. X         ||((rsvp( form ) == UUCP) && (routing != JUSTDOMAIN ))) {
  289. X
  290. X            int look_smart = 0;
  291. X
  292. X            if((routing == REROUTE) && (i == 0)) {
  293. X                look_smart = 1; /* last chance */
  294. X            }
  295. X
  296. X            /* route() puts the new route in 'temp' */
  297. X            if(route(domain,user,look_smart,temp,cost) != EX_OK) {
  298. X                continue;    /* If routing fails, try
  299. X                        /* next larger substring.
  300. X                        /* */
  301. X            }
  302. X/*
  303. X**  After routing, reparse the new route into domain and user. 
  304. X*/
  305. X            form = parse( temp, domain, user );
  306. X
  307. XDEBUG("resolve: parse route '%s' = '%s' @ '%s' (%s)\n",
  308. X    temp,user,domain,sform(form));
  309. X
  310. X        } else if((getcost) && (rsvp(form) == UUCP)) {
  311. X            /* get the cost of the route
  312. X            ** even if we're not going route the mail.
  313. X            ** this allows smart decisions about using
  314. X            ** the -r flag to uux when we're not routing.
  315. X            */
  316. X            char junk[SMLBUF];
  317. X            if(route(domain,user,0,junk,cost) != EX_OK) {
  318. X                continue;    /* If routing fails, try
  319. X                        /* next larger substring.
  320. X                        /* */
  321. X            }
  322. X        }
  323. X        break;    /* route is resolved */
  324. X    }
  325. X/*
  326. X**  For LOCAL mail in non-local format, we rewrite the full address into 
  327. X**  <user> and leave <domain> blank.
  328. X*/
  329. X    if ((rsvp( form ) == LOCAL) && (form != LOCAL )) {
  330. X        build( domain, user, form, temp );
  331. X        (void) strcpy( user, temp );
  332. X        (void) strcpy( domain, "" );
  333. X        form = LOCAL;
  334. X    }
  335. X/*
  336. X**  If we were supposed to route an address but failed (form == ERROR), 
  337. X**  or after routing we are left with an address that still needs to
  338. X**  be routed (rsvp( form ) == ROUTE), complain.
  339. X*/
  340. X    if ((form == ERROR) || (rsvp( form ) == ROUTE )) {
  341. X        exitstat = EX_NOHOST;
  342. X        ADVISE("resolve failed '%s' = '%s' @ '%s' (%s)\n",
  343. X            address, user, domain, sform(form));
  344. X        form = ERROR;
  345. X    } else {
  346. X        ADVISE("resolve '%s' = '%s' @ '%s' (%s)\n",
  347. X            address, user, domain, sform(form));
  348. X    }
  349. X    return ( form );
  350. X}
  351. X
  352. X/*
  353. X**
  354. X**  route(): route domain, plug in user.
  355. X**
  356. X**  Less complicated than it looks.  Each section is documented.
  357. X**
  358. X*/
  359. X
  360. Xroute(domain, user, look_smart, result, cost)
  361. Xchar *domain;            /* domain or host name     */
  362. Xchar *user;            /* user name         */
  363. Xint look_smart;            /* do we try to route through a smarter host? */
  364. Xchar *result;            /* output route     */
  365. Xint *cost;            /* cost of output route */
  366. X{
  367. X    int    uucpdom = 0;
  368. X    int    domains, step;            /* to split domain    */
  369. X    char    *domainv[MAXDOMS];        /* "  "     "        */
  370. X    char    temp[SMLBUF], path[SMLBUF];
  371. X
  372. X/*
  373. X**  Fully qualify the domain, and then strip the last (top level domain) 
  374. X**  component off, so that we look it up separately.
  375. X*/
  376. X    temp[0] = '.';
  377. X    (void) strcpy(temp+1, domain );
  378. X
  379. X    domains = ssplit( temp+1, '.', domainv );
  380. X
  381. X/*
  382. X** check target domain for the local host name and host domain.
  383. X** if it matches, then skip the lookup in the database.
  384. X** this prevents mail loops for cases where SMARTHOST is defined
  385. X** in the routing table, but the local host is not.  It also is
  386. X** a little faster when the local host is the target domain.
  387. X*/
  388. X    if((strcmpic(domain, hostname) == 0)
  389. X    || (strcmpic(domain, hostdomain) == 0)) {
  390. X        step = 0;
  391. X        *cost = 0;
  392. X        (void) strcpy(path, "%s");
  393. XDEBUG("route: '%s' is local\n", domain);
  394. X        goto route_complete;
  395. X    }
  396. X
  397. X    /* If the domain ends in .UUCP, trim that off. */
  398. X    if((domains > 0) && isuucp(domainv[domains-1])) {
  399. X        domains--;
  400. X        domainv[domains][-1] = '\0';
  401. X        uucpdom = 1;
  402. X    }
  403. X/*
  404. X**  Try to get the path for successive components of the domain.  
  405. X**  Example for osgd.cb.att.uucp:
  406. X**    osgd.cb.att
  407. X**    cb.att
  408. X**    att
  409. X**    uucp ( remember stripping top level? )
  410. X**    SMARTHOST
  411. X**  Returns with error if we find no path.
  412. X*/
  413. X    for(step = 0; (step < domains); step++) {
  414. X        if((getpath(domainv[step]-1, path, cost) == EX_OK) /* w/ dot */
  415. X        || (getpath(domainv[step]  , path, cost) == EX_OK))/* no dot */
  416. X            break;
  417. X    }
  418. X
  419. X    if(step == domains) {
  420. X    /*
  421. X    ** we've looked at each component of the domain without success
  422. X    */
  423. X        /*
  424. X        ** If domain is a UUCP address, look for a UUCP gateway.
  425. X        */
  426. X        if((uucpdom == 0) || (getpath(".UUCP", path, cost) != EX_OK)) {
  427. X            /*
  428. X            ** The domain not is a UUCP address, or we can't
  429. X            ** find a UUCP gateway.  If this is our last chance,
  430. X            ** look for a smarter host to deliver the mail.
  431. X            */
  432. X            if((look_smart == 0)
  433. X            || (getpath(SMARTHOST, path, cost) != EX_OK)) {
  434. X                /*
  435. X                ** All our efforts have been in vain.
  436. X                ** Tell them the bad news.
  437. X                */
  438. X                DEBUG("route '%s' failed\n", domain);
  439. X                return( EX_NOHOST );
  440. X            }
  441. X        }
  442. X    }
  443. X
  444. Xroute_complete:
  445. X
  446. XDEBUG("route:  '%s' (%s) = '%s' (%d)\n", domain, domainv[step]?domainv[step]:"NULL", path, *cost);
  447. X
  448. X/*
  449. X**  If we matched on the entire domain name, this address is fully resolved, 
  450. X**  and we plug <user> into it.  If we matched on only part of the domain 
  451. X**  name, we plug <domain>!<user> in.  
  452. X*/
  453. X    build(domain, user, (step == 0) ? LOCAL : UUCP, temp);
  454. X    (void) sprintf(result, path, temp);
  455. X    return( EX_OK );
  456. X}
  457. END_OF_FILE
  458. if test 7634 -ne `wc -c <'mailer/resolve.c'`; then
  459.     echo shar: \"'mailer/resolve.c'\" unpacked with wrong size!
  460. fi
  461. # end of 'mailer/resolve.c'
  462. fi
  463. if test -f 'mailer/template.cf' -a "${1}" != "-c" ; then 
  464.   echo shar: Will not clobber existing file \"'mailer/template.cf'\"
  465. else
  466. echo shar: Extracting \"'mailer/template.cf'\" \(8435 characters\)
  467. sed "s/^X//" >'mailer/template.cf' <<'END_OF_FILE'
  468. X############################################################
  469. X#
  470. X#    SENDMAIL CONFIGURATION FILE
  471. X#
  472. X#    supports internet style addressing
  473. X#    over UUCP and ethernet links.
  474. X#
  475. X#    A product of the UUCP Project.
  476. X#
  477. X#    @(#)template.cf    2.5 (smail) 9/15/87
  478. X#
  479. X############################################################
  480. X
  481. X
  482. X############################################################
  483. X#
  484. X#  Local configuration options - HINTS
  485. X#
  486. X# Host name and domain name macros.
  487. X#
  488. X#    Dw sets $w
  489. X#    DD sets $D
  490. X#    CD sets $=D
  491. X#
  492. X# $D and $=D list all domains in which this host sits.
  493. X# $D goes into outbound addresses, i.e. "user@$w.$D".
  494. X# $A is another domain for which this host is 'authoritative'
  495. X# it will will be turned into $D.
  496. X
  497. XCF_HOST
  498. XCF_DOMAIN
  499. XCF_AUTHORITY
  500. XCF_DCLASS
  501. X
  502. X# Preemptive ether connections.  We prefer these connections 
  503. X# over both designated transport mechanisms and the general depository.
  504. X# You can add more classes (here and in S0).
  505. X
  506. X# /etc/hosts.smtp might be a link to /etc/hosts
  507. X#
  508. XCF_SMTP
  509. X
  510. X# Mock top-level domain names.  These name designate a transport mechanism
  511. X# and appear internally only, set in S3, used in S0, and removed in S4 and
  512. X# (possibly) the ruleset for the particular mailer.  
  513. X
  514. XCTETHER UUX
  515. X
  516. X# Relay host.  Used at the end of S0 as the general depository for 
  517. X# addresses which didn't resolve locally.  
  518. X
  519. XDRrelay
  520. X
  521. X#
  522. X#  End Local configuration options
  523. X#
  524. X############################################################
  525. X
  526. X############################################################
  527. X#
  528. X#    General configuration information
  529. X#
  530. X############################################################
  531. X
  532. XDVsmail2.5/CF_DATE
  533. X
  534. X##########################
  535. X#     Special macros     #
  536. X##########################
  537. X
  538. X# official hostname
  539. XDj$w.$D
  540. X# my name
  541. XDnMAILER-DAEMON
  542. X# UNIX header format
  543. XDlFrom $g  $d
  544. X# delimiter (operator) characters
  545. XDo.:%@!^=/[]
  546. X# format of a total name
  547. XDq$g$?x ($x)$.
  548. X# SMTP login message
  549. XDe$j Sendmail $v/$V ready at $b
  550. X
  551. X
  552. X###################
  553. X#     Options     #
  554. X###################
  555. X
  556. X# location of alias file
  557. XOA/usr/lib/aliases
  558. X# default delivery mode (deliver in background)
  559. XOdbackground
  560. X# (don't) connect to "expensive" mailers
  561. X#Oc
  562. X# temporary file mode
  563. XOF0644
  564. X# default GID
  565. XOg1
  566. X# location of help file
  567. XOH/usr/lib/sendmail.hf
  568. X# log level
  569. XOL9
  570. X# default messages to old style
  571. XOo
  572. X# queue directory
  573. XOQ/usr/spool/mqueue
  574. X# read timeout -- violates protocols
  575. XOr2h
  576. X# status file
  577. XOS/usr/lib/sendmail.st
  578. X# queue up everything before starting transmission
  579. XOs
  580. X# default timeout interval
  581. XOT3d
  582. X# time zone names (V6 only)
  583. XOtPST,PDT
  584. X# default UID
  585. XOu1
  586. X# wizard's password
  587. XOWvoidpasswords
  588. X
  589. X###############################
  590. X#     Message precedences     #
  591. X###############################
  592. X
  593. XPfirst-class=0
  594. XPspecial-delivery=100
  595. XPjunk=-100
  596. X
  597. X#########################
  598. X#     Trusted users     #
  599. X#########################
  600. X
  601. XTroot
  602. XTdaemon
  603. XTuucp
  604. XTnetwork
  605. X
  606. X#############################
  607. X#     Format of headers     #
  608. X#############################
  609. X
  610. X#H?P?Return-Path: <$g>
  611. XHReceived: $?sfrom $s 
  612. X    $.by $j ($v/$V)
  613. X    id $i; $b
  614. XH?D?Resent-Date: $a
  615. XH?D?Date: $a
  616. XH?F?Resent-From: $q
  617. XH?F?From: $q
  618. XH?x?Full-Name: $x
  619. XHSubject:
  620. X# HPosted-Date: $a
  621. X# H?l?Received-Date: $b
  622. XH?M?Resent-Message-Id: <$t.$i@$j>
  623. XH?M?Message-Id: <$t.$i@$j>
  624. X
  625. X############################################################
  626. X#
  627. X#        REWRITING RULES
  628. X#
  629. X
  630. X
  631. X###########################
  632. X#              #
  633. X#  Name Canonicalization  #
  634. X#              #
  635. X###########################
  636. XS3
  637. X
  638. X# basic textual canonicalization
  639. XR<>            $@@                turn into magic token
  640. XR$*<$+>$*        $2                basic RFC821/822 parsing
  641. XR$+ at $+        $1@$2                "at" -> "@" for RFC 822
  642. XR$*<$*>$*        $1$2$3                in case recursive
  643. X
  644. X# handle route-addr <@a,@b,@c:user@d> 
  645. XR@$+,$+            @$1:$2                change all "," to ":"
  646. XR@$+:$+            $@<@$1>:$2            handle <route-addr>
  647. XR$+:$*;@$+        $@$1:$2;@$3            list syntax
  648. X
  649. X# Rewrite address into a domain-based address.  Any special mock domain names 
  650. X# (like UUX) should be defined on the CT line and removed (if necessary) 
  651. X# in S4.  You can use them in S0 for designated transport mechanisms.
  652. X
  653. X# Delimiters with precedence over @.  Add yours here.
  654. X
  655. X# The @ delimiter.  Leave this alone.
  656. XR$+@$+            $:$1<@$2>            focus on domain
  657. XR$+<$+@$+>        $1$2<@$3>            move gaze right
  658. XR$+<@$+>        $@$1<@$2>            already canonical
  659. X
  660. X# Delimiters with precedence below @.  Add yours here.
  661. XR$+^$+            $1!$2                convert ^ to !
  662. XR$-!$+            $@$2<@$1.UUX>            resolve uucp names
  663. XR$+.!$+            $@$2<@$1>            domain.!host
  664. XR$+!$+            $@$2<@$1>            domain!host
  665. X
  666. X# % is a low precedence @.
  667. XR$*%$*            $@$>3$1@$2            %->@ and retry
  668. X
  669. X############################################################
  670. X#
  671. X#            RULESET ZERO PREAMBLE
  672. X#
  673. X############################################################
  674. X
  675. XS0
  676. X
  677. X# first make canonical
  678. XR$*<$*>$*        $1$2$3                defocus
  679. XR$+            $:$>3$1                make canonical
  680. X
  681. X# handle special cases.....
  682. XR@            $#local$:MAILER-DAEMON        handle <> form
  683. XR$*<@[$+]>$*        $#ether$@[$2]$:$1@[$2]$3    numeric internet spec
  684. X
  685. X# strip local stuff
  686. XR$*<@$-.$w.$D>$*    $1<@$2>$3            thishost.mydom
  687. XCF_GATEWAYR$*<@$-.$D>$*    $1<@$2>$3            mydom
  688. XR$*<@$-.$w.$=D>$*    $1<@$2>$4            thishost.anydom
  689. XR$*<@$-.$w.$A>$*    $1<@$2>$3            thishost.anotherdom
  690. XR$*<@$-.$A>$*        $1<@$2>$3            anotherdom
  691. XR$*<@$-.$w.$=T>$*    $1<@$2>$4            thishost.mockdom
  692. XCF_GATEWAYR$*<$*$w>$*    $1<$2>$3            thishost
  693. XR$*<$*.>$*        $1<$2>$3            drop trailing dot
  694. XR<@>:$+            $@$>0$1                strip null route, retry
  695. XR$+<@>            $@$>0$1                strip null addr, retry
  696. X
  697. X
  698. X###############################################
  699. X#    Machine dependent part of ruleset zero   #
  700. X###############################################
  701. X
  702. X# Preemption: for a host on a known link turn the domain spec into a
  703. X# mock domain indicating the link.  One set of these rules for each of 
  704. X# the F classes listed in the local configuration options.
  705. X
  706. XR$*<$*$=E.$D>$*            $:$1<$2$3.ETHER>$4    etherhost.mydomain
  707. XR$*<$*$=E.$=D>$*        $:$1<$2$3.ETHER>$5    etherhost.anydomain
  708. XR$*<$*$=E.$A>$*            $:$1<$2$3.ETHER>$4    etherhost.anotherdomain
  709. XR$*<$*$=E.$=T>$*        $:$1<$2$3.ETHER>$5    etherhost.mock-domain
  710. XR$*<$*$=E>$*            $:$1<$2$3.ETHER>$4    etherhost
  711. X
  712. X# Designated delivery: use the indicated transport mechanism.  One of
  713. X# these rules for each of the mock domains defined in $=T.  You can
  714. X# remove these if you just want general disposition.  HINTS.
  715. X
  716. X# Designated delivery:
  717. XR$*<@$=U.UUX>$*        $#uux$@$2$:$1$3            known uucphost
  718. XR$*<@$=E$+.ETHER>$*    $#ether$@$2$:$1@$2$4        known etherhost
  719. XR$*<@$+.ETHER>$*    $#ether$@$2$:$1@$2$3        etherhost
  720. X
  721. X# throw out mock domain name now
  722. XR$*<$*.$=T>$*        $1<$2>$4
  723. X
  724. X# General disposition of remote mail (comment out all but one).  You
  725. X# might add to this list, if you have other "smarter" mailers.  HINTS.
  726. X
  727. XR$*<@$->:$+        $#uux$@$2$:$1$3            forward to $2
  728. XR$*<@$*>$*        $#uux$@$2$:$1$3            hand to uucp
  729. X#R$*<@$*>$*        $#uux$@$R$:$1@$2$3        hand to uucp relay
  730. X#R$*<@$*>$*        $#ether$@$R$:$1@$2$3        hand to ether relay
  731. X#R$*<$*>$*        $#error$:unknown address $1$2$3    don't hand anywhere
  732. X
  733. X# local delivery
  734. XR$+            $#local$:$1            user
  735. X
  736. X############################################################
  737. X#
  738. X#         Local and Program Mailer specification
  739. X#
  740. X############################################################
  741. X
  742. XCF_SVMAILMlocal, P=CF_LOCALMAIL, F=lsDFMhumSU, S=10, R=20, A=rmail $u
  743. XCF_BSMAILMlocal, P=CF_LOCALMAIL, F=rlsDFMmn, S=10, R=20, A=mail -d $u
  744. XMprog,    P=/bin/sh,   F=lsDFMe,   S=10, R=20, A=sh -c $u
  745. X
  746. XS10
  747. XR@            MAILER-DAEMON    errors to mailer-daemon
  748. XCF_HIDDENHOSTSR$+<@$+.$j>$*        $1<@$j>$3    hide anydom.$j under $j
  749. X
  750. XS20
  751. X
  752. X############################################################
  753. X#
  754. X#            UUCP Mailer specification
  755. X#
  756. X############################################################
  757. X
  758. XMuux,    P=/bin/smail, F=sDFMhum, S=14, R=24, M=100000,
  759. X    A=smail -vH$j $h!$u
  760. X
  761. XS14
  762. XR$+<@$=E>        $1            user@etherhost -> user
  763. XR$*<@$+>$*        $@$1<@$2>$3        already ok
  764. XCF_HIDDENHOSTSR$+<@$+.$j>$*        $1<@$j>$3        hide anydom.$j under $j
  765. XR$+            $@$1<@$j>        add our full address
  766. X
  767. XS24
  768. X
  769. X############################################################
  770. X#
  771. X#            SMTP ethernet mailer
  772. X#
  773. X############################################################
  774. X
  775. XMether,    P=[IPC], F=msDFMuCXP, S=11, R=21, A=IPC $h
  776. X
  777. XS11
  778. XR$*<@$+>$*        $@$1<@$2>$3        already ok
  779. XR$+            $@$1<@$w>        add our hostname
  780. X
  781. XS21
  782. X
  783. X#################################
  784. X#  Final Output Post-rewriting  #
  785. X#################################
  786. X
  787. X# This rewrites the internal $=T mock domains into their external form.
  788. X# The default is to replace the mock domain name with $D.
  789. X# The last two lines are stock.
  790. X
  791. XS4
  792. XR@            $@                handle <> error addr
  793. XR$+<@$-.UUX>        $2!$1                u@host.UUX => host!u
  794. XR$*<$*$=T>$*        $:$1<$2$D>$4            change local info
  795. XR$*<$+>$*        $1$2$3                defocus
  796. XR@$+:$+:$+        @$1,$2:$3            <route-addr> canonical
  797. END_OF_FILE
  798. if test 8435 -ne `wc -c <'mailer/template.cf'`; then
  799.     echo shar: \"'mailer/template.cf'\" unpacked with wrong size!
  800. fi
  801. # end of 'mailer/template.cf'
  802. fi
  803. echo shar: End of archive 4 \(of 8\).
  804. cp /dev/null ark4isdone
  805. MISSING=""
  806. for I in 1 2 3 4 5 6 7 8 ; do
  807.     if test ! -f ark${I}isdone ; then
  808.     MISSING="${MISSING} ${I}"
  809.     fi
  810. done
  811. if test "${MISSING}" = "" ; then
  812.     echo You have unpacked all 8 archives.
  813.     rm -f ark[1-9]isdone
  814. else
  815.     echo You still need to unpack the following archives:
  816.     echo "        " ${MISSING}
  817. fi
  818. ##  End of shell archive.
  819. exit 0
  820.