home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume16 / ida2 / part04 < prev    next >
Text File  |  1988-11-13  |  53KB  |  1,951 lines

  1. Subject:  v16i076:  IDA Sendmail kit, Part04/08
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Lennart Lovstrand <lovstran@arisia.xerox.com>
  7. Posting-number: Volume 16, Issue 76
  8. Archive-name: ida2/part04
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 4 (of 8)."
  17. # Contents:  ida/README ida/aux/dbm.c ida/patches/daemon.c.diff
  18. #   ida/patches/op.me.diff
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f ida/README -a "${1}" != "-c" ; then 
  21.   echo shar: Will not over-write existing file \"ida/README\"
  22. else
  23. echo shar: Extracting \"ida/README\" \(10672 characters\)
  24. sed "s/^X//" >ida/README <<'END_OF_ida/README'
  25. X#
  26. X#  README -- The IDA Sendmail Enhancement Kit.
  27. X#  Copyright (c) 1987, 1988 Lennart Lovstrand
  28. X#  CIS Dept, Univ of Linkoping, Sweden
  29. X#
  30. X#  Use it, abuse it, but don't sell it.
  31. X#
  32. X#  Revision 1 of Wed May 27 04:29:05 MET DST 1987 [sendmail 5.51]
  33. X#  Revision 1.1 of Sun Jun 19 00:36:52 BST 1988 [sendmail 5.58]
  34. X#  Revision 1.2 of Thu Aug 25 13:36:47 BST 1988 [sendmail 5.59]
  35. X#  Revision 1.2.5 of Thu Sep 15 20:17:12 1988 [sendmail 5.59]
  36. X
  37. X
  38. X        Welcome to The IDA Sendmail Enhancement Kit.
  39. X
  40. X
  41. XThis Kit includes a set of source code modifications to the BSD 4.3
  42. Xsendmail program (version 5.59), which will enable it to have direct
  43. Xaccess to dbm(3) files, separate envelope/header rewritings, multi-token
  44. Xclass matches, and many other things.  Also included is the IDA Sendmail
  45. XMaster Configuration file and a sample setup used at the CIS Dept, U of
  46. XLinkoping.  The configuration file together with the supplied data files
  47. Xand utility programs, implement such nice features as pathalias based
  48. Xsystems routing within sendmail, fully !-/@-translating rulesets, and
  49. Xgeneric local user addresses.
  50. X
  51. XThe new sendmail functions are breifly listed below and further
  52. Xdescribed in the accompanying paper, which also discusses electronic
  53. Xmail addressing in general and hybrid addresses in particular.  (The
  54. Xnumbers to the right indicate in what section of the paper they are
  55. Xdescribed.)
  56. X
  57. X   Nameserver Default Argument............................... 7.1
  58. X   Direct Access to Dbm(3) Files............................. 7.2
  59. X   Batched SMTP Support...................................... 7.3
  60. X   Separate Envelope/Header Rewriting Rulesets............... 7.4
  61. X   Separate Local UUCP Host Name............................. 7.5
  62. X   Return Path for UUCP Mailers.............................. 7.6
  63. X   UUCP Header Address Relativization........................ 7.7
  64. X   Support for Multi-Token Matches........................... 7.8
  65. X   Support for Embedded Subruleset Calls..................... 7.9
  66. X   Elaborate Matching Algorithm for Unknown Local Recipients 7.10
  67. X   Support for Maryland's Mdbm Package...................... 7.11
  68. X   Improved Test Mode Output................................ 7.12
  69. X   Better To: and Cc: Headers of Returned Messages.......... 7.13
  70. X   Queue Bug Fixed.......................................... 7.14
  71. X   Shared Input SMTP Bug Tentatively Fixed.................. 7.15
  72. X   Optional BSD 2.9 and 4.2 Compatibility Code.............. 7.16
  73. X   Miscellaneous Changes.................................... 7.17
  74. X
  75. XIf you are reading this without actually having a copy of the kit, look
  76. Xfor it in your nearest comp.sources.unix archive or use anonymous ftp to
  77. Xfetch a compressed tape archive from arisia.xerox.com in ftp1/ida.tar.Z.
  78. X
  79. XRead more in INSTALL about how to get it all together.  Send bug reports
  80. Xand dito fixes to the author, but please note he (and his employer) may
  81. Xbelieve that there is more in life than maintaining everybody else's
  82. Xmail systems.  Also note that this is an unsupported package as far as
  83. Xthe University of Linkoping and Rank Xerox Ltd are concerend -- so do
  84. Xnot go to your local Xerox Copy Center and complain about the rewriting
  85. Xrules.  Remember: you got it for free => you can't get your money back.
  86. X
  87. XEnjoy!
  88. X
  89. X--Lennart Lovstrand
  90. X  Rank Xerox EuroPARC
  91. X  61 Regent Street
  92. X  Cambridge
  93. X  CB2 1AB
  94. X  England
  95. X
  96. X  DARPA Internet: Lovstrand.EuroPARC@Xerox.COM
  97. X  Xerox Internet: Lovstrand:EuroPARC:RX
  98. X
  99. X
  100. X======================================================================
  101. XAddendum for the 2nd release (1.1) of the IDA Sendmail Enhancement Kit
  102. X----------------------------------------------------------------------
  103. X
  104. XRelease 1.1 of the Kit has been upgraded to work with Sun's ported
  105. Xversion of sendmail (5.58).  Only minor changes has been made to
  106. Xsendmail.h.diff and srvrsmtp.c.diff in order to patch the new source
  107. Xcorrectly, but queue.c.diff was removed entirely since that bug now
  108. Xshould be fixed in the BSD release -- subsequently, you should ignore
  109. Xsection 7.14 of the IDA Kit documentation.  Expect some of the patches
  110. Xto install with a minor offset reported by patch -- they have not been
  111. Xchanged since 1.0 but should still be correct.
  112. X
  113. X
  114. X======================================================================
  115. XAddendum for the 3rd release (1.2) of the IDA Sendmail Enhancement Kit
  116. X----------------------------------------------------------------------
  117. X
  118. XA complete new set of patches has been made for this release, which
  119. Xapplies to sendmail 5.59 with MX.  For this, the BSD4.2 and BSD2.9
  120. Xcompatibility code has been removed but it will still compile on Suns
  121. Xwith SunOS 3.x or greater.  A new addition is the support for Sun's
  122. XYellow Pages in the dbm routines--if the name of a database you specify
  123. Xbegins with a percent sign, eg:
  124. X
  125. X    OKP%pathtable
  126. X
  127. Xthen lookups to that database will be handled by YP instead of a local
  128. Xdbm file.  See example in lib/Makefile on how to set up a shared
  129. Xpathalias database for a local area network.
  130. X
  131. XFurthermore, the code that searches dbm files has been changed to
  132. Xautomatically notice if a database has been changed and to reinitialize
  133. Xitself accordingly.  Also, both sendmail and dbm(1) has been modified to
  134. Xuse file locking when updating local dbm files.  This won't help for
  135. Xshared nfs file systems, though--use YP instead.
  136. X
  137. XThe syntax for set (class) declarations has been extended to allow
  138. Xprograms as well as files to define a set.  If a file name in an F
  139. Xstatement begins with a vertical bar, as in:
  140. X
  141. X    FU|uuname
  142. X
  143. Xit is assumed to be followed by the name of a program, which will
  144. Xproduce the set's members on its standard output.  Scanf formats are
  145. Xallowed as usual.
  146. X
  147. XA set of patches received from gamiddleton@waterloo has been included in
  148. Xthis release:
  149. X
  150. X$&x -- Delayed macro evaluation [from gatech?]
  151. X
  152. X    This macro is used in the config file to delay interpretation
  153. X    until run-time.  A typical application would be to delay
  154. X    evaluation of the 'r' macro, which is usually passed to sendmail
  155. X    by other programs to define the sending protocol; e.g. rmail
  156. X    does:
  157. X        sendmail -oMrUUCP ...
  158. X    If you don't use $&r and then freeze the configuration file,
  159. X    you'll get the value of $r at "freezing" time instead of
  160. X    "thawing" time.  Note that this only applies to RHS expressions
  161. X    in rules; use $r elsewhere.
  162. X
  163. X$!x -- RFC822 quoted macro expansion
  164. X
  165. X    Used to keep address legal wrt RFC822 when constructing the
  166. X    From: line for a local user.  The macro is expanded as usual,
  167. X    but if any character in it is illegal, the whole string gets
  168. X    quoted.  Eg, with:
  169. X        Dq$?x$!x $.<$g>
  170. X    an address like 'Joe User @ Waterloo <juser@waterloo.edu>'
  171. X    would be rewritten as '"Joe User @ Waterloo" <juser@waterloo.edu>'
  172. X    to make it legal.
  173. X
  174. XAddress rewriting loop detection
  175. X
  176. X    We found address rewriting was looping if the sendmail.cf file
  177. X    was slightly wrong; this code keeps sendmail from looping forever.
  178. X
  179. XAn extra compile-time frozen file check
  180. X
  181. X    The date of the frozen configuration file is compared to the
  182. X    time sendmail itself was compiled.  If the .fc file is older, it
  183. X    is ignored and the .cf file is used instead.
  184. X
  185. X
  186. XBe aware that you will need the latest version (4.8) of BIND in order to
  187. Xcompile sendmail 5.59 with MX support.  If you don't want to install its
  188. Xinclude and library files in the system directories, add an additional
  189. X-I{bind}/include to CFLAGS in sendmail/src/Makefile and -L{bind}/res in
  190. Xfront of the LIBS variable ({bind} = location of bind directory).
  191. X
  192. XSun users: Make sure that your syslog.o {in /lib/libc.a} has been
  193. Xcompiled with the BSD4.3 netdb.h if you want to use the LOG option.
  194. XAlso note that sendmail compiled with bind's resolver won't use the
  195. XYellow Pages host table at all.  For your convenience, a compressed
  196. Xbinary copy of IDA sendmail for Sun-3 is available in
  197. X~ftp/pub1/ida-sendmail-sun3.Z on Arisia.Xerox.COM via anonymous ftp.
  198. X
  199. X
  200. XNote for BIND experts
  201. X---------------------
  202. XOne of the changes I made to the code was to use the gethostbyname()
  203. Xthat BIND's resolver supplies instead of the internal getcanonname()
  204. Xthat does repeated res_searches for CNAME records.  This was because I
  205. Xneeded both an acknowledgement of the domain's existance as well as its
  206. Xfully qualified name (eg. foo.bar => foo.bar.edu), of which the old code
  207. Xsupported neither.  But this now means that there has to be an IN A
  208. X(Internet address) record for the domain name we wish to canonicalize.
  209. XAnother possible option could have been to modify getcanonname() to do
  210. Xwildcard lookups, but I'm not convinced that's the right way to go.  On
  211. Xthe other hand, I'm no name server wizard, so if you think I'm wrong,
  212. Xplease let me know why (and how) and I'll change it.
  213. X
  214. X
  215. XBugs
  216. X----
  217. X o  There is currently no equivalent of $[...$] for MX records, so the
  218. X    IDA Sendmail.mc file will always use any available pathalias routing
  219. X    before defaulting to MX/TCP.
  220. X o  When a name server responds with an athoritive "host not found",
  221. X    there is currently no way of finding out who is responsible for this
  222. X    information -- we'll need to do our own NS lookups to do so.
  223. X o  It has been reported that a syserr of "net timeout" {in util.c} may
  224. X    cause sendmail to exit ungracefully without removing the lock file
  225. X    and without making a note of which recipients the message already
  226. X    has been delivered to.
  227. X
  228. X
  229. XMinor Revisions
  230. X---------------
  231. X1.2.1 - Various changes to Sendmail.mc regarding its interpretation of
  232. X    hybrid addresses; made to parse according to receiving protocol.
  233. X    (Reimplemented BANGIMPLIESUUCP;    obsoleted UUCPPRECEDENCE; added
  234. X    STRICTLY822, UUCPMAILER.)
  235. X1.2.2 -    Made database lookups NOT send result through sprintf if there
  236. X    was no sprintf arg in call, ie. $(X foo $) or $(X foo $: bar $).
  237. X    This will make it less error-prone for usage with non-pathalias
  238. X    databases.  Note, however, that from this version of IDA, double
  239. X    percent signs will NOT be reduced to single percents (ie, you may
  240. X    need to update your databases if you had adjusted for this before).
  241. X1.2.3 - Split the TCP mailer into TCP and TCP-D (DECnet gateway); added
  242. X    a TCP-U mailer and ruleset 13 for UUCP gateways that require
  243. X    hybrid addresses, ie. UUCP !-paths on top of @-domains (brr).
  244. X    Made sure the h macro (remote host) is defined in buildaddr()
  245. X    before the mailer rulesets are called.  Added TCPMAILER option.
  246. X1.2.4 - Sendmail.mc: A list of well-known pseudo-domains (PSEUDODDOMAINS) 
  247. X    has been added to reduce load on the root name server by
  248. X    avoiding name server lookups on domains ending in these.
  249. X1.2.5 - Sendmail.mc: Experimental support for XNS Mail (XNSMAIL, XNSDOMAIN).
  250. X    Improved the error reporting code in usersmtp.c to mention what
  251. X    host it was talking to when the error occurred.  Also made
  252. X    deliver.c tell a little more about "host unknown" errors.
  253. END_OF_ida/README
  254. if test 10672 -ne `wc -c <ida/README`; then
  255.     echo shar: \"ida/README\" unpacked with wrong size!
  256. fi
  257. # end of overwriting check
  258. fi
  259. if test -f ida/aux/dbm.c -a "${1}" != "-c" ; then 
  260.   echo shar: Will not over-write existing file \"ida/aux/dbm.c\"
  261. else
  262. echo shar: Extracting \"ida/aux/dbm.c\" \(11274 characters\)
  263. sed "s/^X//" >ida/aux/dbm.c <<'END_OF_ida/aux/dbm.c'
  264. X/*
  265. X**  DBM -- General dbm management tool.
  266. X**  Copyright (c) 1987 Lennart Lovstrand
  267. X**  CIS Dept, Univ of Linkoping, Sweden
  268. X**
  269. X**  Use it, abuse it, but don't sell it.
  270. X*/
  271. X
  272. X#include "useful.h"
  273. X#include <stdio.h>
  274. X#include <ctype.h>
  275. X#include <sys/file.h>
  276. X#ifdef MDBM
  277. X# include "mdbm_compat.h"
  278. X#else MDBM
  279. X# include <ndbm.h>
  280. X# define DBMFILE DBM
  281. X# define DB_DIREXT    ".dir"
  282. X# define DB_PAGEXT    ".pag"
  283. X#endif MDBM
  284. X
  285. X#ifndef lint
  286. Xstatic char    SccsId[] = "@(#)dbm.c 2.1 (lel@ida.liu.se) 8/15/88";
  287. X#endif !lint
  288. X
  289. X#define    SAMECASE    0
  290. X#define LOWERCASE    1
  291. X#define UPPERCASE    2
  292. X
  293. X#define COMMENTCHAR    '#'
  294. X#define SENTENIEL    "@@@"
  295. X
  296. X#define streq(s, t)    (strcmp(s, t) == 0)
  297. X#define MAKEDATUM(d, s)    {(d).dptr = s; (d).dsize = strlen(s) + 1;}
  298. X
  299. Xvoid do_clear(), do_delete(), do_dump(), do_fetch(), do_load(), do_make(),
  300. X    do_parse(), do_store();
  301. X
  302. Xstruct comtab {
  303. X    char *c_name;
  304. X    void (*c_func)();
  305. X} CommandTable[] = {
  306. X    {"clear",    do_clear},
  307. X    {"delete",    do_delete},
  308. X    {"dump",    do_dump},
  309. X    {"fetch",    do_fetch},
  310. X    {"load",    do_load},
  311. X    {"make",    do_make},
  312. X    {"parse",    do_parse},
  313. X    {"store",    do_store}
  314. X};
  315. X    
  316. X/* global arguments */
  317. Xint    Argc;
  318. Xchar    **Argv;
  319. X
  320. X/* options */
  321. Xint    Appending = FALSE;
  322. Xint    Casing = SAMECASE;
  323. Xbool    Debug = FALSE;
  324. Xchar    *Outfile = NULL;
  325. Xint    Mode = 0644;
  326. Xchar    *Progname;
  327. Xchar    *Senteniel = NULL;
  328. Xint    Storeflag = DBM_INSERT;
  329. Xbool    Storewarn = TRUE;
  330. X
  331. X/* Dbm globals */
  332. XDBMFILE    *Dbm;
  333. Xchar    *Dbmfile = NULL;
  334. Xint    Dbmaccess;
  335. Xdatum    key, val;
  336. X
  337. Xmain(argc, argv)
  338. X     int argc;
  339. X     char **argv;
  340. X{
  341. X    extern int optind;
  342. X    extern char *optarg;
  343. X    char *scantoken();
  344. X    struct comtab *cmd;
  345. X    int c;
  346. X
  347. X    Argc = argc;
  348. X    Argv = argv;
  349. X
  350. X    Progname = Argv[0];
  351. X
  352. X    while ((c = getopt(Argc, Argv, "ADILRSUd:m:o:s:")) != EOF)
  353. X    switch (c) {
  354. X      case 'A':
  355. X        Appending = TRUE;
  356. X        break;
  357. X      case 'D':
  358. X        Debug = TRUE;
  359. X        break;
  360. X      case 'I':
  361. X        Storeflag = DBM_INSERT;
  362. X        Storewarn = FALSE;
  363. X        break;
  364. X      case 'L':
  365. X        Casing = LOWERCASE;
  366. X        break;
  367. X      case 'R':
  368. X        Storeflag = DBM_REPLACE;
  369. X        break;
  370. X      case 'S':
  371. X        if (Senteniel == NULL)
  372. X        Senteniel = SENTENIEL;
  373. X        break;
  374. X      case 'U':
  375. X        Casing = UPPERCASE;
  376. X        break;
  377. X      case 'd':
  378. X        Dbmfile = optarg;
  379. X        break;
  380. X      case 'm':
  381. X        if (optarg[0] == '0')
  382. X        (void) sscanf(optarg, "%o", &Mode);
  383. X        else {
  384. X        (void) sscanf(optarg, "%d", &Mode);
  385. X        if (Mode == 0) {
  386. X            (void) fprintf(stderr, "%s: non-numeric mode: %s\n",
  387. X                   Progname, optarg);
  388. X            exit(1);
  389. X        }
  390. X        }
  391. X        break;
  392. X      case 'o':
  393. X        Outfile = optarg;
  394. X        break;
  395. X      case 's':
  396. X        Senteniel = optarg;
  397. X        break;
  398. X      default:
  399. X        (void) fprintf(stderr,
  400. X               "usage: %s [-ADILNRSU] [-d dbm_file] [-m mode] %s", 
  401. X               Progname, "[-o output_file] command [args]\n");
  402. X        exit(1);
  403. X    }
  404. X
  405. X    Argc -= optind;
  406. X    Argv += optind;
  407. X
  408. X    if (Argc > 0) {
  409. X    for (cmd = CommandTable; cmd < &CommandTable[sizeof(CommandTable) /
  410. X                             sizeof(*CommandTable)];
  411. X         cmd++)
  412. X        if (streq(*Argv, cmd->c_name)) {
  413. X        (*cmd->c_func)();
  414. X        exit(0);
  415. X        }
  416. X    (void) fprintf(stderr, "%s: unknown dbm command %s", Progname, *Argv);
  417. X    } else
  418. X    (void) fprintf(stderr, "%s: missing dbm command", Progname);
  419. X    (void) fprintf(stderr, ", use one of the following:\n");
  420. X    for (cmd = CommandTable; cmd < &CommandTable[sizeof(CommandTable) /
  421. X                         sizeof(*CommandTable)]; cmd++)
  422. X    (void) fprintf(stderr, "%s%s", cmd == CommandTable ? "" : "\t",
  423. X               cmd->c_name);
  424. X    (void) fprintf(stderr, "\n");
  425. X    exit(3);
  426. X}
  427. X
  428. Xopendbm(access)
  429. X     int access;
  430. X{
  431. X    if (Dbmfile == NULL) {
  432. X    if (Argc > 1) {
  433. X        /* use last argument */
  434. X        Dbmfile = Argv[Argc-1];
  435. X        Argc--;
  436. X    } else {
  437. X        (void) fprintf(stderr, "%s: dbm file not specified\n", Progname);
  438. X        exit(3);
  439. X    }
  440. X    }
  441. X    Dbm = dbm_open(Dbmfile, access, Mode);
  442. X    if (Dbm == NULL) {
  443. X    char *filename = (char *) malloc(strlen(Dbmfile) + 20);
  444. X    sprintf(filename, "%s{%s,%s}", Dbmfile, DB_DIREXT, DB_PAGEXT);
  445. X    perror(filename);
  446. X    exit(4);
  447. X    }
  448. X    (void) flock(dbm_dirfno(Dbm), LOCK_EX);
  449. X    Dbmaccess = access;
  450. X}
  451. X
  452. Xclosedbm()
  453. X{
  454. X    if ((Dbmaccess & O_RDONLY) == 0 && Senteniel != NULL) {
  455. X    MAKEDATUM(key, Senteniel);
  456. X    if (dbm_store(Dbm, key, key, DBM_REPLACE) != NULL) {
  457. X        (void) fprintf(stderr, "%s: could not store senteniel \"%s\"\n",
  458. X               Progname, Senteniel);
  459. X        perror(Progname);
  460. X        exit(5);
  461. X    }
  462. X    }
  463. X    
  464. X    (void) flock(dbm_dirfno(Dbm), LOCK_UN);
  465. X    dbm_close(Dbm);
  466. X}
  467. X
  468. XFILE *
  469. Xopenfile(filename, access)
  470. X     char *filename;
  471. X     char *access;
  472. X{
  473. X    FILE *f;
  474. X
  475. X    if (streq(filename, "-"))
  476. X    if (streq(access, "r"))
  477. X        return stdin;
  478. X    else
  479. X        return stdout;
  480. X    else {
  481. X    f = fopen(filename, access);
  482. X    if (f == NULL) {
  483. X        perror(filename);
  484. X        exit(4);
  485. X    }
  486. X    return f;
  487. X    }
  488. X}
  489. X
  490. Xvoid
  491. Xclosefile(f)
  492. X     FILE *f;
  493. X{
  494. X    if (f != stdin && f != stdout)
  495. X    (void) fclose(f);
  496. X}
  497. X /*
  498. X**    DO_CLEAR -- Clear out database leaving it emtpy.
  499. X*/
  500. X
  501. Xvoid
  502. Xdo_clear()
  503. X{
  504. X    if (Dbmfile != NULL) {
  505. X    opendbm(O_RDWR | O_CREAT | O_TRUNC);
  506. X    closedbm();
  507. X    }
  508. X    while (Argc > 1) {
  509. X    opendbm(O_RDWR | O_CREAT | O_TRUNC);
  510. X    closedbm();
  511. X    }
  512. X}
  513. X
  514. X   
  515. X /*
  516. X**    DO_DELETE -- Delete individual entries from the database.
  517. X*/
  518. X
  519. Xvoid
  520. Xdo_delete()
  521. X{
  522. X    opendbm(O_RDWR | O_CREAT);
  523. X
  524. X    for (Argc--, Argv++; Argc > 0; Argc--, Argv++) {
  525. X    casify(*Argv, Casing);
  526. X    MAKEDATUM(key, *Argv);
  527. X    if (dbm_delete(Dbm, key) != NULL) {
  528. X        perror(*Argv);
  529. X        exit(5);
  530. X    }
  531. X    }
  532. X
  533. X    closedbm();
  534. X}
  535. X
  536. X /*
  537. X**    DO_DUMP -- List all entries in the database.
  538. X*/
  539. Xvoid
  540. Xdo_dump()
  541. X{
  542. X    FILE *output;
  543. X    
  544. X    opendbm(O_RDONLY);
  545. X
  546. X    if (Outfile == NULL)
  547. X    output = stdout;
  548. X    else
  549. X    output = openfile(Outfile, "w");
  550. X
  551. X#ifdef MDBM
  552. X    for (key = dbm_firstkey(Dbm); key.dptr != NULL; key = dbm_nextkey(Dbm, key)) {
  553. X#else MDBM
  554. X    for (key = dbm_firstkey(Dbm); key.dptr != NULL; key = dbm_nextkey(Dbm)) {
  555. X#endif MDBM
  556. X    val = dbm_fetch(Dbm, key);
  557. X    if (val.dptr == NULL)
  558. X        perror(key.dptr);
  559. X    else
  560. X        (void) fprintf(output, "%s\t%s\n", key.dptr, val.dptr);
  561. X    }
  562. X}
  563. X /*
  564. X**    DO_FETCH -- Lookup individual keys in the database.
  565. X*/
  566. Xvoid
  567. Xdo_fetch()
  568. X{
  569. X    opendbm(O_RDONLY);
  570. X
  571. X    for (Argc--, Argv++; Argc > 0; Argc--, Argv++) {
  572. X    casify(*Argv, Casing);
  573. X    MAKEDATUM(key, *Argv);
  574. X    val = dbm_fetch(Dbm, key);
  575. X    if (val.dptr == NULL)
  576. X        (void) printf("%s\t[NOT FOUND]\n", *Argv);
  577. X    else
  578. X        (void) printf("%s\t%s\n", *Argv, val.dptr);
  579. X    }
  580. X
  581. X    closedbm();
  582. X}
  583. X
  584. X /*
  585. X**    DO_STORE -- Insert individual entries into the database.
  586. X*/
  587. X
  588. Xvoid
  589. Xdo_store()
  590. X{
  591. X    /* barf if # of args - 1 is even and no dbm file has been specified */
  592. X    if (Argc & 1 == 1 && Dbmfile == NULL) {
  593. X    (void) fprintf(stderr, "%s: no dbm file specified\n", Progname);
  594. X    exit(3);
  595. X    }
  596. X
  597. X    opendbm(O_RDWR | O_CREAT);
  598. X
  599. X    for (Argc--, Argv++; Argc > 1; Argc -= 2, Argv += 2) {
  600. X    casify(Argv[0], Casing);
  601. X    MAKEDATUM(key, Argv[0]);
  602. X    MAKEDATUM(val, Argv[1]);
  603. X    if (dbm_store(Dbm, key, val, Storeflag) != NULL) {
  604. X        extern int errno;
  605. X
  606. X        if (errno != 0) {
  607. X        perror(Argv[0]);
  608. X        exit(5);
  609. X        } else if (Storewarn)
  610. X        (void) fprintf(stderr,
  611. X                   "%s: duplicate key \"%s\" => \"%s\" ignored\n",
  612. X                   Progname, Argv[0], Argv[1]);
  613. X    }
  614. X    }
  615. X    if (Argc > 0)
  616. X    (void) fprintf(stderr, "%s: no value for last key \"%s\"--ignored\n",
  617. X               Progname, Argv[0]);
  618. X
  619. X    closedbm();
  620. X}
  621. X
  622. X /*
  623. X**    DO_PARSE -- Parse a textual database file and produce key-value
  624. X**        pairs separated by a tab (suitable for input to the ``load''
  625. X**        function).
  626. X*/
  627. X
  628. Xvoid
  629. Xdo_parse()
  630. X{
  631. X    FILE *input, *output;
  632. X    
  633. X    if (Outfile == NULL)
  634. X    output = stdout;
  635. X    else
  636. X    output = openfile(Outfile, "w");
  637. X
  638. X    if (Argc == 1)
  639. X    parsefile(stdin, output);
  640. X    else
  641. X    for (Argc--, Argv++; Argc > 0; Argc--, Argv++) {
  642. X        input = openfile(*Argv, "r");
  643. X        parsefile(input, output);
  644. X        closefile(input);
  645. X    }
  646. X}
  647. X
  648. X /*
  649. X**    DO_MAKE -- Parse the textual input and load the result into
  650. X**        the database.
  651. X*/
  652. X
  653. Xvoid
  654. Xdo_make()
  655. X{
  656. X    FILE *input, *pipin, *pipout;
  657. X    int pipes[2];
  658. X
  659. X    opendbm(O_RDWR | O_CREAT | (Appending ? 0 : O_TRUNC));
  660. X
  661. X    if (pipe(pipes) != NULL) {
  662. X    perror("pipe");
  663. X    exit(9);
  664. X    }
  665. X    pipin = fdopen(pipes[0], "r");
  666. X    pipout = fdopen(pipes[1], "w");
  667. X
  668. X    if (fork() == 0) {
  669. X    /* child process */
  670. X    (void) fclose(pipout);
  671. X
  672. X    loadfile(pipin);
  673. X    } else {
  674. X    /* parent process */
  675. X    (void) fclose(pipin);
  676. X
  677. X    if (Argc == 1)
  678. X        parsefile(stdin, pipout);
  679. X    else
  680. X        for (Argc--, Argv++; Argc > 0; Argc--, Argv++) {
  681. X        input = openfile(*Argv, "r");
  682. X        parsefile(input, pipout);
  683. X        closefile(input);
  684. X        }
  685. X    }
  686. X    closedbm();
  687. X}
  688. X
  689. X /*
  690. X**    DO_LOAD -- Load the dbm database from a text file.  The input should
  691. X**        be key-value pairs separated by a tab, each on a single line.
  692. X*/
  693. X
  694. Xvoid
  695. Xdo_load()
  696. X{
  697. X    FILE *input;
  698. X
  699. X    opendbm(O_RDWR | O_CREAT | (Appending ? 0 : O_TRUNC));
  700. X
  701. X    if (Argc == 1)
  702. X    loadfile(stdin);
  703. X    else
  704. X    for (Argc--, Argv++; Argc > 0; Argc--, Argv++) {
  705. X        input = openfile(*Argv, "r");
  706. X        loadfile(input);
  707. X        closefile(input);
  708. X    }
  709. X    closedbm();
  710. X}    
  711. X
  712. X /*
  713. X**    PARSEFILE, LOADFILE
  714. X*/ 
  715. X
  716. Xparsefile(input, output)
  717. X     FILE *input, *output;
  718. X{
  719. X    extern char *index();
  720. X    char buf[BUFSIZ], *key, *val = NULL;
  721. X    register char *p;
  722. X
  723. X    while (fgets(buf, sizeof(buf), input) != NULL) {
  724. X    if (buf[0] == COMMENTCHAR || buf[0] == '\n' || buf[0] == '\0')
  725. X        continue;
  726. X    if (!isspace(buf[0])) {
  727. X        /* extract value */
  728. X        p = scantoken(buf);
  729. X        if (val != NULL)
  730. X        free(val);
  731. X        val = (char *) malloc(p - buf + 1);
  732. X        (void) strncpy(val, buf, p - buf);
  733. X        val[p - buf] = '\0';
  734. X    }
  735. X    casify(buf, Casing);
  736. X    for (p = buf; *p != '\0';) {
  737. X        while (*p != '\0' && isspace(*p)) p++;
  738. X        if (*p == '\0' || *p == COMMENTCHAR)
  739. X        break;
  740. X        key = p;
  741. X        p = scantoken(p);
  742. X        if (*p == COMMENTCHAR)
  743. X        *p = '\0';
  744. X        else if (*p != '\0')
  745. X        *p++ = '\0';
  746. X        (void) fprintf(output, "%s\t%s\n", key, val);
  747. X    }
  748. X    }
  749. X}
  750. X
  751. Xloadfile(input)
  752. X     FILE *input;
  753. X{
  754. X    char buf[BUFSIZ];
  755. X    register char *tab, *nl;
  756. X    extern char *index();
  757. X
  758. X    while (fgets(buf, sizeof(buf), input) != NULL) {
  759. X    nl = index(buf, '\n');
  760. X    if (nl != NULL)
  761. X        *nl = '\0';
  762. X
  763. X    tab = index(buf, '\t');
  764. X    if (tab == NULL) {
  765. X        (void) fprintf(stderr, "%s: missing tab in \"%s\"--ignored\n",
  766. X               Progname, buf);
  767. X        continue;
  768. X    }
  769. X    *tab++ = '\0';
  770. X    casify(buf, Casing);
  771. X    MAKEDATUM(key, buf);
  772. X    MAKEDATUM(val, tab);
  773. X    if (dbm_store(Dbm, key, val, Storeflag) != NULL && Storewarn) {
  774. X        extern int errno;
  775. X
  776. X        if (errno != 0) {
  777. X        perror(buf);
  778. X        exit(5);
  779. X        } else if (Storewarn)
  780. X        (void) fprintf(stderr,
  781. X                   "%s: duplicate key \"%s\" => \"%s\" ignored\n",
  782. X                   Progname, buf, tab);
  783. X    }
  784. X    }
  785. X}
  786. X
  787. Xchar *
  788. Xscantoken(p)
  789. X     register char *p;
  790. X{
  791. X  register bool quotedchar = FALSE, insidestring = FALSE, insideroute = FALSE;
  792. X
  793. X  /* hidious address scanner */
  794. X  while (*p != '\0' && (quotedchar || insidestring || insideroute || 
  795. X            (*p != COMMENTCHAR && !isspace(*p)))) {
  796. X    /* special quote character handling */
  797. X    if (quotedchar)
  798. X      quotedchar = FALSE;
  799. X    else {
  800. X      quotedchar = (*p == '\\');
  801. X      if (!insidestring)
  802. X    if (*p == '<')
  803. X      insideroute = TRUE;
  804. X    else if (*p == '>')
  805. X      insideroute = FALSE;
  806. X      if (*p == '"')
  807. X    insidestring = !insidestring;
  808. X    }
  809. X    p++;
  810. X  }
  811. X
  812. X  return p;
  813. X}
  814. X
  815. Xcasify(p, c)
  816. X     register char *p;
  817. X     int c;
  818. X{
  819. X    switch (c) {
  820. X      case LOWERCASE:
  821. X    for (; *p != '\0'; p++)
  822. X        if (isupper(*p))
  823. X        *p = tolower(*p);
  824. X    break;
  825. X      case UPPERCASE:
  826. X    for (; *p != '\0'; p++)
  827. X        if (islower(*p))
  828. X        *p = toupper(*p);
  829. X    break;
  830. X    }
  831. X}
  832. END_OF_ida/aux/dbm.c
  833. if test 11274 -ne `wc -c <ida/aux/dbm.c`; then
  834.     echo shar: \"ida/aux/dbm.c\" unpacked with wrong size!
  835. fi
  836. # end of overwriting check
  837. fi
  838. if test -f ida/patches/daemon.c.diff -a "${1}" != "-c" ; then 
  839.   echo shar: Will not over-write existing file \"ida/patches/daemon.c.diff\"
  840. else
  841. echo shar: Extracting \"ida/patches/daemon.c.diff\" \(11203 characters\)
  842. sed "s/^X//" >ida/patches/daemon.c.diff <<'END_OF_ida/patches/daemon.c.diff'
  843. X*** daemon.c.orig    Sat Apr  2 00:43:22 1988
  844. X--- daemon.c    Tue Aug 30 01:57:23 1988
  845. X***************
  846. X*** 32,37 ****
  847. X--- 32,40 ----
  848. X  # include <sys/wait.h>
  849. X  # include <sys/time.h>
  850. X  # include <sys/resource.h>
  851. X+ # include <sys/file.h>
  852. X+ # include <sys/types.h>
  853. X+ # include <sys/stat.h>
  854. X  
  855. X  /*
  856. X  **  DAEMON.C -- routines to use when running as a daemon.
  857. X***************
  858. X*** 62,67 ****
  859. X--- 65,78 ----
  860. X  **    maphostname(hbuf, hbufsize)
  861. X  **        Convert the entry in hbuf into a canonical form.  It
  862. X  **        may not be larger than hbufsize.
  863. X+ **
  864. X+ **    mapinit(c)
  865. X+ **        Open and initialize a dbm database.  Reopen if our current
  866. X+ **        file descriptor is out of date.
  867. X+ **
  868. X+ **    mapkey(c, key, argval, argsiz)
  869. X+ **        Search a database for a match to the given key, sprintf'ing
  870. X+ **        the argument through the result if found.
  871. X  */
  872. X   /*
  873. X  **  GETREQUESTS -- open mail IPC port and get requests.
  874. X***************
  875. X*** 492,520 ****
  876. X  }
  877. X  
  878. X  /*
  879. X!  *  MAPHOSTNAME -- turn a hostname into canonical form
  880. X!  *
  881. X!  *    Parameters:
  882. X!  *        hbuf -- a buffer containing a hostname.
  883. X!  *        hbsize -- the size of hbuf.
  884. X!  *
  885. X!  *    Returns:
  886. X!  *        none.
  887. X!  *
  888. X!  *    Side Effects:
  889. X!  *        Looks up the host specified in hbuf.  If it is not
  890. X!  *        the canonical name for that host, replace it with
  891. X!  *        the canonical name.  If the name is unknown, or it
  892. X!  *        is already the canonical name, leave it unchanged.
  893. X!  */
  894. X  maphostname(hbuf, hbsize)
  895. X      char *hbuf;
  896. X      int hbsize;
  897. X  {
  898. X      register struct hostent *hp;
  899. X!     u_long in_addr;
  900. X!     char ptr[256];
  901. X!     struct hostent *gethostbyaddr();
  902. X  
  903. X      /*
  904. X       * If first character is a bracket, then it is an address
  905. X--- 503,532 ----
  906. X  }
  907. X  
  908. X  /*
  909. X! **  MAPHOSTNAME -- turn a hostname into canonical form
  910. X! **
  911. X! **    Parameters:
  912. X! **        hbuf -- a buffer containing a hostname.
  913. X! **        hbsize -- the size of hbuf.
  914. X! **
  915. X! **    Returns:
  916. X! **        An exit code telling if the hostname was found and
  917. X! **        canonicalized.
  918. X! **
  919. X! **    Side Effects:
  920. X! **        Looks up the host specified in hbuf.  If it is not
  921. X! **        the canonical name for that host, replace it with
  922. X! **        the canonical name.  If the name is unknown, or it
  923. X! **        is already the canonical name, leave it unchanged.
  924. X! **/
  925. X! bool
  926. X  maphostname(hbuf, hbsize)
  927. X      char *hbuf;
  928. X      int hbsize;
  929. X  {
  930. X      register struct hostent *hp;
  931. X!     extern struct hostent *gethostbyname();
  932. X!     static char tmphbuf[MAXNAME];
  933. X  
  934. X      /*
  935. X       * If first character is a bracket, then it is an address
  936. X***************
  937. X*** 522,543 ****
  938. X       * strip the brackets and to preserve hbuf if address is
  939. X       * unknown.
  940. X       */
  941. X!     if (*hbuf != '[') {
  942. X!         getcanonname(hbuf, hbsize);
  943. X!         return;
  944. X      }
  945. X!     *index(strcpy(ptr, hbuf), ']') = '\0';
  946. X!     in_addr = inet_addr(&ptr[1]);
  947. X!     hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
  948. X      if (hp == NULL)
  949. X!         return;
  950. X      if (strlen(hp->h_name) >= hbsize)
  951. X          hp->h_name[hbsize - 1] = '\0';
  952. X!     (void)strcpy(hbuf, hp->h_name);
  953. X  }
  954. X  
  955. X  # else DAEMON
  956. X! /* code for systems without sophisticated networking */
  957. X  
  958. X  /*
  959. X  **  MYHOSTNAME -- stub version for case of no daemon code.
  960. X--- 534,573 ----
  961. X       * strip the brackets and to preserve hbuf if address is
  962. X       * unknown.
  963. X       */
  964. X!     if (*hbuf == '[')
  965. X!     {
  966. X!         extern struct hostent *gethostbyaddr();
  967. X!         u_long in_addr;
  968. X! 
  969. X!         (void) strncpy(tmphbuf, hbuf+1, strlen(hbuf)-2);
  970. X!         in_addr = inet_addr(tmphbuf);
  971. X!         hp = gethostbyaddr((char *) &in_addr, sizeof(struct in_addr), AF_INET);
  972. X      }
  973. X!     else
  974. X!     {
  975. X!         hp = gethostbyname(hbuf);
  976. X!         if (hp == NULL) {
  977. X!             /* try lowercase version */
  978. X!             (void) strcpy(tmphbuf, hbuf);
  979. X!             (void) makelower(tmphbuf);
  980. X!         }
  981. X!     }
  982. X! #ifdef DEBUG
  983. X!     if (tTd(9, 1))
  984. X!         printf("maphostname(%s, %d) => %.*s\n",
  985. X!             hbuf, hbsize, hbsize-1, hp ? hp->h_name : "NOT_FOUND");
  986. X! #endif DEBUG
  987. X      if (hp == NULL)
  988. X!         return FALSE;
  989. X! 
  990. X      if (strlen(hp->h_name) >= hbsize)
  991. X          hp->h_name[hbsize - 1] = '\0';
  992. X!     (void) strcpy(hbuf, hp->h_name);
  993. X!     return TRUE;
  994. X  }
  995. X  
  996. X  # else DAEMON
  997. X!  /* code for systems without sophisticated networking */
  998. X  
  999. X  /*
  1000. X  **  MYHOSTNAME -- stub version for case of no daemon code.
  1001. X***************
  1002. X*** 564,570 ****
  1003. X      }
  1004. X      return (NULL);
  1005. X  }
  1006. X!  /*
  1007. X  **  MAPHOSTNAME -- turn a hostname into canonical form
  1008. X  **
  1009. X  **    Parameters:
  1010. X--- 594,601 ----
  1011. X      }
  1012. X      return (NULL);
  1013. X  }
  1014. X! 
  1015. X! /*
  1016. X  **  MAPHOSTNAME -- turn a hostname into canonical form
  1017. X  **
  1018. X  **    Parameters:
  1019. X***************
  1020. X*** 572,578 ****
  1021. X  **        hbsize -- the size of hbuf.
  1022. X  **
  1023. X  **    Returns:
  1024. X! **        none.
  1025. X  **
  1026. X  **    Side Effects:
  1027. X  **        Looks up the host specified in hbuf.  If it is not
  1028. X--- 603,610 ----
  1029. X  **        hbsize -- the size of hbuf.
  1030. X  **
  1031. X  **    Returns:
  1032. X! **        An exit code telling if the hostname was found and
  1033. X! **        canonicalized.
  1034. X  **
  1035. X  **    Side Effects:
  1036. X  **        Looks up the host specified in hbuf.  If it is not
  1037. X***************
  1038. X*** 586,592 ****
  1039. X      char *hbuf;
  1040. X      int hbsize;
  1041. X  {
  1042. X!     return;
  1043. X  }
  1044. X  
  1045. X  #endif DAEMON
  1046. X--- 618,876 ----
  1047. X      char *hbuf;
  1048. X      int hbsize;
  1049. X  {
  1050. X!     return (FALSE);
  1051. X  }
  1052. X  
  1053. X  #endif DAEMON
  1054. X+  /*
  1055. X+ **  MAPINIT -- Open and (re)initialize a dbm database
  1056. X+ **
  1057. X+ **    Parameters:
  1058. X+ **        c -- the (one character) name of the database
  1059. X+ **
  1060. X+ **    Returns:
  1061. X+ **        An exit code telling if we could open the database.
  1062. X+ **
  1063. X+ */
  1064. X+ #ifdef NDBM
  1065. X+ bool
  1066. X+ mapinit(c)
  1067. X+     char c;
  1068. X+ {
  1069. X+     struct stat stb;
  1070. X+     struct dbm_table *db;
  1071. X+     char buf[MAXNAME];
  1072. X+ 
  1073. X+     db = &DbmTab[c & 0177];
  1074. X+ 
  1075. X+     if (db->db_name == NULL) {
  1076. X+     syserr("database '%c' has not been defined", c);
  1077. X+     return FALSE;
  1078. X+     }
  1079. X+ 
  1080. X+ #ifdef YPMARK
  1081. X+     /*
  1082. X+      * Yellow pages are always supposed to be ready
  1083. X+      */
  1084. X+     if (db->db_name[0] == YPMARK)
  1085. X+     return TRUE;
  1086. X+ #endif YPMARK
  1087. X+ 
  1088. X+     /*
  1089. X+      * Have we already (unsuccessfully) tried to open it?
  1090. X+      */
  1091. X+     if (db->db_dbm == DB_NOSUCHFILE) {
  1092. X+ #ifdef DEBUG
  1093. X+     if (tTd(60, 1))
  1094. X+         printf("mapinit(%c) => NO_FILE\n", c);
  1095. X+ #endif DEBUG
  1096. X+     return FALSE;
  1097. X+     }
  1098. X+ 
  1099. X+     /*
  1100. X+      * If it already is open, check if it has been changed.
  1101. X+      */
  1102. X+     (void) sprintf(buf, "%s%s", db->db_name, DB_DIREXT);
  1103. X+     if (db->db_dbm != DB_NOTYETOPEN) {
  1104. X+     if (stat(buf, &stb) < 0 && (sleep(30), stat(buf, &stb) < 0)) {
  1105. X+         syserr("somebody removed %s for db '%c'", buf, c);
  1106. X+         db->db_dbm = DB_NOSUCHFILE;
  1107. X+ #ifdef DEBUG
  1108. X+         if (tTd(60, 1))
  1109. X+         printf("mapinit(%c) => FILE_REMOVED\n", c);
  1110. X+ #endif DEBUG
  1111. X+         return FALSE;
  1112. X+     }
  1113. X+     if (db->db_mtime != stb.st_mtime) {
  1114. X+ #ifdef DEBUG
  1115. X+         if (tTd(60, 1))
  1116. X+         printf("database '%c' [%s] has changed; reopening it\n",
  1117. X+                c, db->db_name);
  1118. X+ #endif DEBUG
  1119. X+         (void) dbm_close(db->db_dbm);
  1120. X+         db->db_dbm = DB_NOTYETOPEN;
  1121. X+     }
  1122. X+     }
  1123. X+ 
  1124. X+     /*
  1125. X+      * Initialize database if not already open (r/w for aliases)
  1126. X+      */
  1127. X+     if (db->db_dbm == DB_NOTYETOPEN) {
  1128. X+     db->db_dbm = dbm_open(db->db_name,
  1129. X+                   c == DB_ALIAS ? O_RDWR : O_RDONLY, 0);
  1130. X+     if (db->db_dbm == DB_NOSUCHFILE) {
  1131. X+         /* try once more */
  1132. X+         sleep(30);
  1133. X+         db->db_dbm = dbm_open(db->db_name,
  1134. X+                   c == DB_ALIAS ? O_RDWR : O_RDONLY, 0);
  1135. X+     }
  1136. X+     if (db->db_dbm == DB_NOSUCHFILE) {
  1137. X+         syserr("can't open database '%c' [%s]", c, db->db_name);
  1138. X+ #ifdef DEBUG
  1139. X+         if (tTd(60, 1))
  1140. X+         printf("mapinit(%c) => CAN'T OPEN %s\n", c, db->db_name);
  1141. X+ #endif DEBUG
  1142. X+         return FALSE;
  1143. X+     }
  1144. X+     if (stat(buf, &stb) < 0 && (sleep(30), stat(buf, &stb) < 0)) {
  1145. X+         syserr("can't stat %s", buf);
  1146. X+ #ifdef DEBUG
  1147. X+         if (tTd(60, 1))
  1148. X+         printf("mapinit(%c) => FILE_REMOVED\n", c);
  1149. X+ #endif DEBUG
  1150. X+         return FALSE;
  1151. X+     }
  1152. X+     db->db_mtime = stb.st_mtime;
  1153. X+ 
  1154. X+     /*
  1155. X+      * Make sure the database isn't being updated
  1156. X+      */
  1157. X+     if (flock(dbm_dirfno(db->db_dbm), LOCK_EX | LOCK_NB) < 0)
  1158. X+         if (errno == EWOULDBLOCK) {
  1159. X+ #ifdef DEBUG
  1160. X+         if (tTd(60, 1))
  1161. X+             printf("%s%s is locked, waiting...\n",
  1162. X+                db->db_name, DB_DIREXT);
  1163. X+ #endif DEBUG
  1164. X+         (void) flock(dbm_dirfno(db->db_dbm), LOCK_EX);
  1165. X+         } else
  1166. X+         syserr("flock failed for db %c [%s]", c, db->db_name);
  1167. X+     (void) flock(dbm_dirfno(db->db_dbm), LOCK_UN);
  1168. X+     }
  1169. X+     return TRUE;
  1170. X+ }
  1171. X+  /*
  1172. X+ **  MAPKEY -- Search a dbm database.
  1173. X+ **
  1174. X+ **    Search the named database using the given key.  If
  1175. X+ **    a result is found, sprintf the argument through the
  1176. X+ **    result back into the key and return TRUE;
  1177. X+ **    otherwise return FALSE and do nothing.
  1178. X+ **
  1179. X+ **    Keysize may also be given as zero, in which case the
  1180. X+ **    sprintf'ed result is returned if the key matched.
  1181. X+ **
  1182. X+ **    Parameters:
  1183. X+ **        c -- the database
  1184. X+ **        key -- search string
  1185. X+ **        argval -- sprintf argument & result
  1186. X+ **        argsiz -- size of argval
  1187. X+ **
  1188. X+ **    Returns:
  1189. X+ **        An exit code telling if there was a match.
  1190. X+ **
  1191. X+ **    Side Effects:
  1192. X+ **        The argval is rewritten to reflect what was found
  1193. X+ **        in the database.
  1194. X+ */
  1195. X+ 
  1196. X+ mapkey(c, key, keysiz, arg)
  1197. X+     char c, *key, *arg;
  1198. X+     int keysiz;
  1199. X+ {
  1200. X+     struct dbm_table *db;
  1201. X+     DATUM dkey, result;
  1202. X+     static char lowkey[MAXNAME];
  1203. X+ #ifdef YPMARK
  1204. X+     static char *yp_domain = NULL;
  1205. X+ #endif YPMARK
  1206. X+ 
  1207. X+     db = &DbmTab[c & 0177];
  1208. X+ 
  1209. X+ #ifdef DEBUG
  1210. X+     if (tTd(60, 1))
  1211. X+     printf("mapkey('%c', \"%s\", \"%s\") => ", c, key, arg ? arg : "--");
  1212. X+ #endif DEBUG
  1213. X+ 
  1214. X+     /*
  1215. X+      * Init the database; return if failure
  1216. X+      */
  1217. X+     if (!mapinit(c))
  1218. X+     return FALSE;
  1219. X+ 
  1220. X+     /*
  1221. X+      * Normalize key (ie turn it to lowercase)
  1222. X+      */
  1223. X+     (void) strcpy(lowkey, key);
  1224. X+     (void) makelower(lowkey);
  1225. X+ 
  1226. X+ #ifdef YPMARK
  1227. X+     /*
  1228. X+      * Test for yellow page database first
  1229. X+      */
  1230. X+     if (db->db_name[0] == YPMARK) {
  1231. X+     if (yp_domain == NULL)
  1232. X+         (void) yp_get_default_domain(&yp_domain);
  1233. X+ 
  1234. X+     /*
  1235. X+      * We include the null after the string, but Sun doesn't
  1236. X+      */
  1237. X+     if (yp_match(yp_domain, &db->db_name[1], lowkey,
  1238. X+              strlen(key)+1, &result.dptr, &result.dsize) != 0 &&
  1239. X+         yp_match(yp_domain, &db->db_name[1], lowkey,
  1240. X+              strlen(key), &result.dptr, &result.dsize) != 0)
  1241. X+         result.dptr = NULL;
  1242. X+     else
  1243. X+         /* smash newline */
  1244. X+         result.dptr[result.dsize] = '\0';
  1245. X+     } else {
  1246. X+ #endif YPMARK
  1247. X+     /*
  1248. X+      * Go look for matching dbm entry
  1249. X+      */
  1250. X+     dkey.dptr = lowkey;
  1251. X+     dkey.dsize = strlen(dkey.dptr) + 1;
  1252. X+     result = dbm_fetch(db->db_dbm, dkey);
  1253. X+ #ifdef YPMARK
  1254. X+     }
  1255. X+ #endif YPMARK
  1256. X+ 
  1257. X+     /*
  1258. X+      * Well, were we successful?
  1259. X+      */
  1260. X+     if (result.dptr == NULL) {
  1261. X+ #ifdef DEBUG
  1262. X+     if (tTd(60, 1))
  1263. X+         printf("NOT_FOUND\n");
  1264. X+ #endif DEBUG
  1265. X+     return FALSE;
  1266. X+     }
  1267. X+ 
  1268. X+     /*
  1269. X+      * Yes, rewrite result if sprintf arg was given.
  1270. X+      */
  1271. X+     if (arg == NULL)
  1272. X+     (void) strcpy(lowkey, result.dptr);
  1273. X+     else
  1274. X+     (void) sprintf(lowkey, result.dptr, arg);
  1275. X+     /* if keysiz is zero, that means we should return a string from the heap */
  1276. X+     if (keysiz == 0)
  1277. X+     key = newstr(lowkey);
  1278. X+     else {
  1279. X+     if (strlen(lowkey)+1 > keysiz) {
  1280. X+         syserr("mapkey: result \"%s\" too long after expansion\n",
  1281. X+            lowkey, keysiz);
  1282. X+         lowkey[keysiz-1] = '\0';
  1283. X+     }
  1284. X+     (void) strcpy(key, lowkey);
  1285. X+     }
  1286. X+ #ifdef DEBUG
  1287. X+     if (tTd(60, 1))
  1288. X+     printf("%s\n", key);
  1289. X+ #endif DEBUG
  1290. X+ 
  1291. X+     /* Ugly kludge that assumes that sizeof(int) == sizeof(char *) */
  1292. X+     return (int) key;
  1293. X+ }
  1294. X+ 
  1295. X+ #else NDBM
  1296. X+ 
  1297. X+ /* should really read the table into the stab instead */
  1298. X+ mapkey(db, key, keysiz, arg)
  1299. X+     char db, *key, *arg;
  1300. X+     int keysiz;
  1301. X+ {
  1302. X+     return FALSE;
  1303. X+ }
  1304. X+ 
  1305. X+ #endif NDBM
  1306. END_OF_ida/patches/daemon.c.diff
  1307. if test 11203 -ne `wc -c <ida/patches/daemon.c.diff`; then
  1308.     echo shar: \"ida/patches/daemon.c.diff\" unpacked with wrong size!
  1309. fi
  1310. # end of overwriting check
  1311. fi
  1312. if test -f ida/patches/op.me.diff -a "${1}" != "-c" ; then 
  1313.   echo shar: Will not over-write existing file \"ida/patches/op.me.diff\"
  1314. else
  1315. echo shar: Extracting \"ida/patches/op.me.diff\" \(15423 characters\)
  1316. sed "s/^X//" >ida/patches/op.me.diff <<'END_OF_ida/patches/op.me.diff'
  1317. X*** op.me.orig    Thu May  5 22:28:51 1988
  1318. X--- op.me    Thu Aug 25 15:15:49 1988
  1319. X***************
  1320. X*** 7,13 ****
  1321. X  .\"
  1322. X  .\"    @(#)op.me    5.8 (Berkeley) 5/9/86
  1323. X  .\"
  1324. X! .\" eqn % | troff -me
  1325. X  .\"if n .ls 2
  1326. X  .\".he 'Sendmail Installation and Operation Guide''%'
  1327. X  .\".fo 'Version 5.8''Last Mod 5/9/86'
  1328. X--- 7,13 ----
  1329. X  .\"
  1330. X  .\"    @(#)op.me    5.8 (Berkeley) 5/9/86
  1331. X  .\"
  1332. X! .\" pic % | eqn | troff -me
  1333. X  .\"if n .ls 2
  1334. X  .\".he 'Sendmail Installation and Operation Guide''%'
  1335. X  .\".fo 'Version 5.8''Last Mod 5/9/86'
  1336. X***************
  1337. X*** 40,46 ****
  1338. X  Eric Allman
  1339. X  Britton-Lee, Inc.
  1340. X  .sp
  1341. X! Version 5.8
  1342. X  .)l
  1343. X  .sp 2
  1344. X  .pp
  1345. X--- 40,51 ----
  1346. X  Eric Allman
  1347. X  Britton-Lee, Inc.
  1348. X  .sp
  1349. X! .sz 8
  1350. X! Enhancements by Lennart L\o"o\(um"vstrand
  1351. X! Rank Xerox EuroPARC, Cambridge, England
  1352. X! .sz 10
  1353. X! .sp
  1354. X! Version 5.8++
  1355. X  .)l
  1356. X  .sp 2
  1357. X  .pp
  1358. X***************
  1359. X*** 524,529 ****
  1360. X--- 529,546 ----
  1361. X  will print the contents of the mail queue;
  1362. X  see below).
  1363. X  This should be a link to /usr/lib/sendmail.
  1364. X+ .sh 3 "/usr/ucb/bsmtp"
  1365. X+ .pp
  1366. X+ If
  1367. X+ .i sendmail
  1368. X+ is invoked as
  1369. X+ .q bsmtp,
  1370. X+ it will simulate the
  1371. X+ .b \-bb
  1372. X+ flag (i.e.,
  1373. X+ .i sendmail
  1374. X+ will start accepting batched SMTP commands from stdin; see below).
  1375. X+ This should be a link to /usr/lib/sendmail.
  1376. X  .sh 1 "NORMAL OPERATIONS"
  1377. X  .sh 2 "Quick Configuration Startup"
  1378. X  .pp
  1379. X***************
  1380. X*** 823,834 ****
  1381. X  .(b
  1382. X  name: name1, name2, ...
  1383. X  .)b
  1384. X! Only local names may be aliased;
  1385. X  e.g.,
  1386. X  .(b
  1387. X  eric@mit-xx: eric@berkeley.EDU
  1388. X  .)b
  1389. X! will not have the desired effect.
  1390. X  Aliases may be continued by starting any continuation lines
  1391. X  with a space or a tab.
  1392. X  Blank lines and lines beginning with a sharp sign
  1393. X--- 840,855 ----
  1394. X  .(b
  1395. X  name: name1, name2, ...
  1396. X  .)b
  1397. X! It is possible not
  1398. X! only local names may be aliased,
  1399. X! but even non-locals if the configuration file is properly set up;
  1400. X  e.g.,
  1401. X  .(b
  1402. X  eric@mit-xx: eric@berkeley.EDU
  1403. X  .)b
  1404. X! will have the desired effect if the
  1405. X! .i aliases
  1406. X! database is searched before determining mailer in ruleset 0.
  1407. X  Aliases may be continued by starting any continuation lines
  1408. X  with a space or a tab.
  1409. X  Blank lines and lines beginning with a sharp sign
  1410. X***************
  1411. X*** 1136,1141 ****
  1412. X--- 1157,1170 ----
  1413. X  it defaults to
  1414. X  .i sendmail.cf
  1415. X  in the current directory.
  1416. X+ .pp
  1417. X+ You can also specify a different frozen configuration file with the
  1418. X+ .b \-Z
  1419. X+ option.  It is used the same way as the
  1420. X+ .b \-C
  1421. X+ flag and defaults to
  1422. X+ .i sendmail.fc
  1423. X+ in the current directory.
  1424. X  .sh 2 "Changing the Values of Options"
  1425. X  .pp
  1426. X  Options can be overridden using the
  1427. X***************
  1428. X*** 1705,1712 ****
  1429. X  .ta 1i
  1430. X  Path    The pathname of the mailer
  1431. X  Flags    Special flags for this mailer
  1432. X! Sender    A rewriting set for sender addresses
  1433. X! Recipient    A rewriting set for recipient addresses
  1434. X  Argv    An argument vector to pass to this mailer
  1435. X  Eol    The end-of-line string for this mailer
  1436. X  Maxsize    The maximum message length to this mailer
  1437. X--- 1734,1741 ----
  1438. X  .ta 1i
  1439. X  Path    The pathname of the mailer
  1440. X  Flags    Special flags for this mailer
  1441. X! Sender    Rewriting sets for sender addresses
  1442. X! Recipient    Rewriting sets for recipient addresses
  1443. X  Argv    An argument vector to pass to this mailer
  1444. X  Eol    The end-of-line string for this mailer
  1445. X  Maxsize    The maximum message length to this mailer
  1446. X***************
  1447. X*** 1868,1873 ****
  1448. X--- 1897,1920 ----
  1449. X  .b $| )
  1450. X  clause may be omitted.
  1451. X  .pp
  1452. X+ To make sure that a string (phrase) conforms with RFC822, a special
  1453. X+ construct
  1454. X+ .b $! \c
  1455. X+ .i x
  1456. X+ can be used.  When it is expanded, it will be checked against certain
  1457. X+ illegal character and quoted using a pair of double quotes if necessary.
  1458. X+ This would typically be used when defining the
  1459. X+ .i q
  1460. X+ macro as in:
  1461. X+ .(b
  1462. X+ Dq$?x$!x $.<$g>
  1463. X+ .)b
  1464. X+ Here, an address like `Joe User @ Waterloo <juser@waterloo.edu>' would
  1465. X+ be rewritten as `"Joe User @ Waterloo" <juser@waterloo.edu>' in order to
  1466. X+ make it legal.  See more below on the
  1467. X+ .i q
  1468. X+ macro.
  1469. X+ .pp
  1470. X  The following macros
  1471. X  .i must
  1472. X  be defined to transmit information into
  1473. X***************
  1474. X*** 1878,1886 ****
  1475. X  j    The \*(lqofficial\*(rq domain name for this site
  1476. X  l    The format of the UNIX from line
  1477. X  n    The name of the daemon (for error messages)
  1478. X! o    The set of "operators" in addresses
  1479. X! q    default format of sender address
  1480. X  .)b
  1481. X  The
  1482. X  .b $e
  1483. X  macro is printed out when SMTP starts up.
  1484. X--- 1925,1944 ----
  1485. X  j    The \*(lqofficial\*(rq domain name for this site
  1486. X  l    The format of the UNIX from line
  1487. X  n    The name of the daemon (for error messages)
  1488. X! o    The set of \*(lqoperators\*(rq in addresses
  1489. X! q    Default format of sender address
  1490. X  .)b
  1491. X+ In addition, you also have the
  1492. X+ .b $k
  1493. X+ macro:
  1494. X+ .(b
  1495. X+ .ta 4n
  1496. X+ k    Your node's UUCP hostname
  1497. X+ .)b
  1498. X+ which is optional to define (it defaults to the value of
  1499. X+ .b $w,
  1500. X+ your normal hostname).
  1501. X+ .pp
  1502. X  The
  1503. X  .b $e
  1504. X  macro is printed out when SMTP starts up.
  1505. X***************
  1506. X*** 2087,2094 ****
  1507. X  and
  1508. X  .b $s
  1509. X  fields are set to the protocol used to communicate with sendmail
  1510. X! and the sending hostname;
  1511. X! these are not supported in the current version.
  1512. X  .sh 3 "Special classes"
  1513. X  .pp
  1514. X  The class
  1515. X--- 2145,2151 ----
  1516. X  and
  1517. X  .b $s
  1518. X  fields are set to the protocol used to communicate with sendmail
  1519. X! and the sending hostname.
  1520. X  .sh 3 "Special classes"
  1521. X  .pp
  1522. X  The class
  1523. X***************
  1524. X*** 2107,2114 ****
  1525. X  \fB$*\fP    Match zero or more tokens
  1526. X  \fB$+\fP    Match one or more tokens
  1527. X  \fB$\-\fP    Match exactly one token
  1528. X! \fB$=\fP\fIx\fP    Match any token in class \fIx\fP
  1529. X! \fB$~\fP\fIx\fP    Match any token not in class \fIx\fP
  1530. X  .)b
  1531. X  If any of these match,
  1532. X  they are assigned to the symbol
  1533. X--- 2164,2171 ----
  1534. X  \fB$*\fP    Match zero or more tokens
  1535. X  \fB$+\fP    Match one or more tokens
  1536. X  \fB$\-\fP    Match exactly one token
  1537. X! \fB$=\fP\fIx\fP    Match any sequence of tokens in class \fIx\fP
  1538. X! \fB$~\fP\fIx\fP    Match any sequence of tokens not in class \fIx\fP
  1539. X  .)b
  1540. X  If any of these match,
  1541. X  they are assigned to the symbol
  1542. X***************
  1543. X*** 2141,2149 ****
  1544. X  unless they begin with a dollar sign.
  1545. X  Metasymbols are:
  1546. X  .(b
  1547. X! .ta \w'$#mailer  'u
  1548. X  \fB$\fP\fIn\fP    Substitute indefinite token \fIn\fP from LHS
  1549. X! \fB$[\fP\fIname\fP\fB$]\fP    Canonicalize \fIname\fP
  1550. X  \fB$>\fP\fIn\fP    \*(lqCall\*(rq ruleset \fIn\fP
  1551. X  \fB$#\fP\fImailer\fP    Resolve to \fImailer\fP
  1552. X  \fB$@\fP\fIhost\fP    Specify \fIhost\fP
  1553. X--- 2198,2208 ----
  1554. X  unless they begin with a dollar sign.
  1555. X  Metasymbols are:
  1556. X  .(b
  1557. X! .ta \w'$(x key$@arg$:default$)  'u
  1558. X  \fB$\fP\fIn\fP    Substitute indefinite token \fIn\fP from LHS
  1559. X! \fB$&\fP\fIx\fP    Force runtime evaluation of macro \fIx\fP
  1560. X! \fB$[\fP\fIname\fP\fB$:\fP\fIdefault\fP\fB$]\fP    Canonicalize \fIname\fP
  1561. X! \fB$(\fP\fIx key\fP\fB$@\fP\fIarg\fP\fB$:\fP\fIdefault\fP\fB$)\fP    Lookup the \fIkey\fP in database \fIx\fP, and sprintf \fIarg\fP through the result.
  1562. X  \fB$>\fP\fIn\fP    \*(lqCall\*(rq ruleset \fIn\fP
  1563. X  \fB$#\fP\fImailer\fP    Resolve to \fImailer\fP
  1564. X  \fB$@\fP\fIhost\fP    Specify \fIhost\fP
  1565. X***************
  1566. X*** 2178,2184 ****
  1567. X--- 2237,2304 ----
  1568. X  .q $[[128.32.130.2]$]
  1569. X  would become
  1570. X  .q vangogh.berkeley.edu.
  1571. X+ The
  1572. X+ .b $: \c
  1573. X+ .i default
  1574. X+ part is optional and specifies what should be substituted
  1575. X+ in case that the
  1576. X+ .i name
  1577. X+ is not known to 
  1578. X+ .i gethostent \|(3).
  1579. X  .pp
  1580. X+ General 
  1581. X+ .i dbm \|(3)
  1582. X+ databases may be searched using the
  1583. X+ .b $( \c
  1584. X+ .i "x key" \c
  1585. X+ .b $)
  1586. X+ syntax.  The expression may be supplied with an optional result argument,
  1587. X+ .b $@ \c
  1588. X+ .i arg,
  1589. X+ and a default string,
  1590. X+ .b $: \c
  1591. X+ .i default.
  1592. X+ The database is specified by a single character and defined using the
  1593. X+ .q K
  1594. X+ option as in
  1595. X+ .(b
  1596. X+ OKP/usr/lib/mail/pathtable
  1597. X+ .)b
  1598. X+ which defines database
  1599. X+ .b P
  1600. X+ to be associated with the dbm files /usr/lib/mail/pathtable.{dir,pag}.
  1601. X+ You can also make sendmail search a
  1602. X+ .i "Yellow Pages"
  1603. X+ database if your machine supports this.  To do this, use the same
  1604. X+ definition as above but prefix the map name with a percent sign, as in:
  1605. X+ .(b
  1606. X+ OKP%mail.aliases
  1607. X+ .)b
  1608. X+ Only maps in your default domain can currently be accessed.
  1609. X+ An expression like
  1610. X+ .q "$(P sun $@ soren $: backbone!sun!soren $)"
  1611. X+ would look for the string
  1612. X+ .q sun
  1613. X+ in the
  1614. X+ .q P
  1615. X+ database and sprintf
  1616. X+ .q soren
  1617. X+ through the result, or substitute
  1618. X+ .q backbone!sun!soren
  1619. X+ if the key could not be found.
  1620. X+ If no 
  1621. X+ .i default
  1622. X+ argument is supplied and the key could not be found, the whole
  1623. X+ expression is replaced with the key.
  1624. X+ .pp
  1625. X+ The aliases database is automatically available as database
  1626. X+ .b @ .
  1627. X+ It can either be defined using the
  1628. X+ .b A
  1629. X+ option or by a
  1630. X+ .b OK@
  1631. X+ declaration and is in both cases allowed to be a YP map.
  1632. X+ .pp
  1633. X  The
  1634. X  .b $> \c
  1635. X  .i n
  1636. X***************
  1637. X*** 2191,2197 ****
  1638. X  then becomes
  1639. X  the substitution for this rule.
  1640. X  .pp
  1641. X! The
  1642. X  .b $#
  1643. X  syntax should
  1644. X  .i only
  1645. X--- 2311,2317 ----
  1646. X  then becomes
  1647. X  the substitution for this rule.
  1648. X  .pp
  1649. X! In most cases, the
  1650. X  .b $#
  1651. X  syntax should
  1652. X  .i only
  1653. X***************
  1654. X*** 2236,2252 ****
  1655. X  .b $@
  1656. X  and
  1657. X  .b $:
  1658. X! prefixes may precede a
  1659. X  .b $>
  1660. X! spec;
  1661. X  for example:
  1662. X  .(b
  1663. X  .ta 8n
  1664. X! R$+    $:$>7$1
  1665. X  .)b
  1666. X  matches anything,
  1667. X! passes that to ruleset seven,
  1668. X! and continues;
  1669. X  the
  1670. X  .b $:
  1671. X  is necessary to avoid an infinite loop.
  1672. X--- 2356,2372 ----
  1673. X  .b $@
  1674. X  and
  1675. X  .b $:
  1676. X! prefixes may precede
  1677. X  .b $>
  1678. X! specs;
  1679. X  for example:
  1680. X  .(b
  1681. X  .ta 8n
  1682. X! R$+    $:$>7$>8$1
  1683. X  .)b
  1684. X  matches anything,
  1685. X! passes that to ruleset eight and the result of that to ruleset seven,
  1686. X! and finally continues;
  1687. X  the
  1688. X  .b $:
  1689. X  is necessary to avoid an infinite loop.
  1690. X***************
  1691. X*** 2253,2260 ****
  1692. X  .pp
  1693. X  Substitution occurs in the order described,
  1694. X  that is,
  1695. X! parameters from the LHS are substituted,
  1696. X! hostnames are canonicalized,
  1697. X  .q subroutines
  1698. X  are called,
  1699. X  and finally
  1700. X--- 2373,2380 ----
  1701. X  .pp
  1702. X  Substitution occurs in the order described,
  1703. X  that is,
  1704. X! parameters from the LHS are substituted and runtime macros are expanded,
  1705. X! hostnames are canonicalized and database lookups are performed,
  1706. X  .q subroutines
  1707. X  are called,
  1708. X  and finally
  1709. X***************
  1710. X*** 2710,2720 ****
  1711. X  as it proceeds,
  1712. X  finally showing you the address it ends up with.
  1713. X  You may use a comma separated list of rwsets
  1714. X! for sequential application of rules to an input;
  1715. X! ruleset three is always applied first.
  1716. X  For example:
  1717. X  .(b
  1718. X! 1,21,4 monet:bollard
  1719. X  .)b
  1720. X  first applies ruleset three to the input
  1721. X  .q monet:bollard.
  1722. X--- 2830,2839 ----
  1723. X  as it proceeds,
  1724. X  finally showing you the address it ends up with.
  1725. X  You may use a comma separated list of rwsets
  1726. X! for sequential application of rules to an input.
  1727. X  For example:
  1728. X  .(b
  1729. X! 3,1,21,4 monet:bollard
  1730. X  .)b
  1731. X  first applies ruleset three to the input
  1732. X  .q monet:bollard.
  1733. X***************
  1734. X*** 2854,2859 ****
  1735. X--- 2973,2979 ----
  1736. X  Other flags are described
  1737. X  in Appendix C.
  1738. X  .pp
  1739. X+ .pp
  1740. X  The S and R fields in the mailer description
  1741. X  are per-mailer rewriting sets
  1742. X  to be applied to sender and recipient addresses
  1743. X***************
  1744. X*** 2884,2889 ****
  1745. X--- 3004,3016 ----
  1746. X  These sets can also be used
  1747. X  to do special purpose output rewriting
  1748. X  in cooperation with ruleset four.
  1749. X+ If required, the R and S rulesets may be specified independently for envelope
  1750. X+ and header addresses by separating them with a slash.  E.g.,
  1751. X+ .q R=13/14
  1752. X+ means that envelope recipient addresses should be sent through ruleset 13
  1753. X+ while those in the header should be passed to ruleset 14. 
  1754. X+ You can disable any mailer specific rewriting by specifying the ruleset as
  1755. X+ zero or by leaving it blank.
  1756. X  .pp
  1757. X  The E field defines the string to use
  1758. X  as an end-of-line indication.
  1759. X***************
  1760. X*** 3026,3031 ****
  1761. X--- 3153,3159 ----
  1762. X  i    Initialize the alias database
  1763. X  p    Print the mail queue
  1764. X  z    Freeze the configuration file
  1765. X+ b    Run in Batched SMTP mode
  1766. X  .)b
  1767. X  The special processing for the
  1768. X  ARPANET
  1769. X***************
  1770. X*** 3050,3055 ****
  1771. X--- 3178,3188 ----
  1772. X  .i Sendmail
  1773. X  runs as the invoking user (rather than root)
  1774. X  when this flag is specified.
  1775. X+ .ip \-Z\fIfile\fP
  1776. X+ Use a different frozen configuration file.
  1777. X+ .i Sendmail
  1778. X+ runs as the invoking user (rather than root)
  1779. X+ when this flag is specified.
  1780. X  .ip \-d\fIlevel\fP
  1781. X  Set debugging level.
  1782. X  .ip \-o\fIx\|value\fP
  1783. X***************
  1784. X*** 3166,3171 ****
  1785. X--- 3299,3318 ----
  1786. X  for SMTP.
  1787. X  .ip i
  1788. X  Ignore dots in incoming messages.
  1789. X+ .ip K\fIxfile\fP
  1790. X+ Declare the 
  1791. X+ keyed database
  1792. X+ .i x
  1793. X+ to be associated with the 
  1794. X+ .i dbm \|(3)
  1795. X+ file
  1796. X+ .i file.
  1797. X+ (\fIX\fP is a single letter.)
  1798. X+ The database
  1799. X+ .q @
  1800. X+ is always bound to the 
  1801. X+ .i aliases
  1802. X+ database.
  1803. X  .ip L\fIn\fP
  1804. X  Set the default log level to
  1805. X  .i n .
  1806. X***************
  1807. X*** 3406,3415 ****
  1808. X  will not terminate the message prematurely.
  1809. X  .ip L
  1810. X  Limit the line lengths as specified in RFC821.
  1811. X! .ip P
  1812. X  Use the return-path in the SMTP
  1813. X  .q "MAIL FROM:"
  1814. X! command
  1815. X  rather than just the return address;
  1816. X  although this is required in RFC821,
  1817. X  many hosts do not process return paths properly.
  1818. X--- 3553,3564 ----
  1819. X  will not terminate the message prematurely.
  1820. X  .ip L
  1821. X  Limit the line lengths as specified in RFC821.
  1822. X! .ip p
  1823. X  Use the return-path in the SMTP
  1824. X  .q "MAIL FROM:"
  1825. X! command or in the UUCP
  1826. X! .q From_
  1827. X! line
  1828. X  rather than just the return address;
  1829. X  although this is required in RFC821,
  1830. X  many hosts do not process return paths properly.
  1831. X***************
  1832. X*** 3450,3455 ****
  1833. X--- 3599,3620 ----
  1834. X  Escape lines beginning with
  1835. X  .q From
  1836. X  in the message with a `>' sign.
  1837. X+ .ip V
  1838. X+ Make all header addresses UUCP !-relative with respect to ourselves
  1839. X+ and the recipient host.  This means that all header lines will have
  1840. X+ working paths relative to the recipient host.  Routes through the
  1841. X+ remote host, i.e. addresses that begin with
  1842. X+ .q remote!
  1843. X+ are stripped of that part unless the ultimate
  1844. X+ recipient resides on the remote host (i.e., there are no more bangs in
  1845. X+ the address).  All other addresses are prefixed with
  1846. X+ .q ourhost!
  1847. X+ if not already there.
  1848. X+ .i Ourhost
  1849. X+ is fetched from the 
  1850. X+ .b $k
  1851. X+ macro, which defaults to your hostname as supplied by
  1852. X+ .i gethostname \|(3).
  1853. X  .+c "OTHER CONFIGURATION"
  1854. X  .rm $0
  1855. X  .nr ii 1i
  1856. X***************
  1857. X*** 3603,3608 ****
  1858. X--- 3768,3782 ----
  1859. X  that allows multiple databases will be used.
  1860. X  .q DBM
  1861. X  must also be set.
  1862. X+ .ip MDBM
  1863. X+ If set, Maryland's
  1864. X+ .i mdbm \|(3)
  1865. X+ package should be substituted for the
  1866. X+ .i ndbm \|(3)
  1867. X+ routines.  This should only be used if you want the keyed database
  1868. X+ functionality (\fB$(x key$)\fP), but don't have
  1869. X+ .i ndbm \|(3)
  1870. X+ available.
  1871. X  .ip DEBUG
  1872. X  If set, debugging information is compiled in.
  1873. X  To actually get the debugging output,
  1874. X***************
  1875. X*** 3929,3935 ****
  1876. X  .ip "/usr/lib/sendmail"
  1877. X  The binary of
  1878. X  .i sendmail .
  1879. X! .ip /usr/bin/newaliases
  1880. X  A link to /usr/lib/sendmail;
  1881. X  causes the alias database to be rebuilt.
  1882. X  Running this program is completely equivalent to giving
  1883. X--- 4103,4109 ----
  1884. X  .ip "/usr/lib/sendmail"
  1885. X  The binary of
  1886. X  .i sendmail .
  1887. X! .ip /usr/ucb/newaliases
  1888. X  A link to /usr/lib/sendmail;
  1889. X  causes the alias database to be rebuilt.
  1890. X  Running this program is completely equivalent to giving
  1891. X***************
  1892. X*** 3937,3948 ****
  1893. X  the
  1894. X  .b \-bi
  1895. X  flag.
  1896. X! .ip /usr/bin/mailq
  1897. X  Prints a listing of the mail queue.
  1898. X  This program is equivalent to using the
  1899. X  .b \-bp
  1900. X  flag to
  1901. X  .i sendmail .
  1902. X  .ip /usr/lib/sendmail.cf
  1903. X  The configuration file,
  1904. X  in textual form.
  1905. X--- 4111,4128 ----
  1906. X  the
  1907. X  .b \-bi
  1908. X  flag.
  1909. X! .ip /usr/ucb/mailq
  1910. X  Prints a listing of the mail queue.
  1911. X  This program is equivalent to using the
  1912. X  .b \-bp
  1913. X  flag to
  1914. X  .i sendmail .
  1915. X+ .ip /usr/ucb/bsmtp
  1916. X+ A link to /usr/lib/sendmail; starts up
  1917. X+ .i sendmail
  1918. X+ in Batched SMTP mode (as if supplied with the
  1919. X+ .b \-bb
  1920. X+ option).
  1921. X  .ip /usr/lib/sendmail.cf
  1922. X  The configuration file,
  1923. X  in textual form.
  1924. END_OF_ida/patches/op.me.diff
  1925. if test 15423 -ne `wc -c <ida/patches/op.me.diff`; then
  1926.     echo shar: \"ida/patches/op.me.diff\" unpacked with wrong size!
  1927. fi
  1928. # end of overwriting check
  1929. fi
  1930. echo shar: End of archive 4 \(of 8\).
  1931. cp /dev/null ark4isdone
  1932. MISSING=""
  1933. for I in 1 2 3 4 5 6 7 8 ; do
  1934.     if test ! -f ark${I}isdone ; then
  1935.     MISSING="${MISSING} ${I}"
  1936.     fi
  1937. done
  1938. if test "${MISSING}" = "" ; then
  1939.     echo You have unpacked all 8 archives.
  1940.     echo "See ida/README and ida/INSTALL for further directions."
  1941.     rm -f ark[1-9]isdone
  1942. else
  1943.     echo You still need to unpack the following archives:
  1944.     echo "        " ${MISSING}
  1945. fi
  1946. ##  End of shell archive.
  1947. exit 0
  1948.  
  1949.