home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / sendmail / UCB / sendmail.8.6.2.patch.Z / sendmail.8.6.2.patch
Encoding:
Text File  |  1993-10-14  |  41.5 KB  |  1,700 lines

  1. Apply this patch to update an 8.6.1 sendmail to 8.6.2.
  2.  
  3. *** RELEASE_NOTES.OLD    Sat Oct  9 08:04:28 1993
  4. --- RELEASE_NOTES    Fri Oct 15 09:00:07 1993
  5. ***************
  6. *** 1,3 ****
  7. --- 1,49 ----
  8. + 8.6.2/8.6.2    93/10/15
  9. +     Put a "successful delivery" message in the transcript for
  10. +         addresses that get return-receipts.
  11. +     Put a prominent "this is only a warning" message in warning
  12. +         messages -- some people don't read carefully enough
  13. +         and end up sending the message several times.
  14. +     Include reason for temporary failure in the "warning" return
  15. +         message.  Currently, it just says "cannot send for
  16. +         four hours".
  17. +     Fix the "Original message received" time generated for
  18. +         returntosender messages.  It was previously listed as
  19. +         the current time.  Bug reported by Eric Hagberg of
  20. +         Cornell University Medical College.
  21. +     If there is an error when writing the body of a message,
  22. +         don't send the trailing dot and wait for a response
  23. +         in sender SMTP, as this could cause the connection to
  24. +         hang up under some bizarre circumstances.  From Eric
  25. +         Wassenaar.
  26. +     Fix some server SMTP synchronization problems caused when
  27. +         connections fail during message collection.  From
  28. +         Eric Wassenaar.
  29. +     Fix a problem that can cause srvrsmtp to reject mail if the
  30. +         name server is down -- it accepts the RCPT but rejects
  31. +         the DATA command.  Problem reported by Jim Murray of
  32. +         Stratus.
  33. +     Fix a problem that can cause core dumps if the config file
  34. +         incorrectly resolves to a null hostname.  Reported by
  35. +         Allan Johannesen of WPI.
  36. +     Non-root use of -C flag, dangerous -f flags, and use of -oQ
  37. +         by non-root users were not put into
  38. +         X-Authentication-Warning:s as intended because the
  39. +         config file hadn't set the PrivacyFlags yet.  Fix
  40. +         from Sven-Ove Westberg of the University of Lulea.
  41. +     Under very odd circumstances, the alias file rebuild code
  42. +         could get confused as to whether a database was
  43. +         open or not.
  44. +     Check "vendor code" on the end of V lines -- this is
  45. +         intended to provide a hook for vendor-specific
  46. +         configuration syntax.  (This is a "new feature",
  47. +         but I've made an exception to my rule in a belief
  48. +         that this is a highly exceptional case.)
  49. +     Portability fixes for DG/UX (from Douglas Anderson of NCSC),
  50. +         SCO Unix (from Murray Kucherawy), A/UX, and OSF/1
  51. +         (from Jon Forrest of UC Berkeley)
  52. +     CONFIG: fix ``mailer:host'' form of UUCP relay naming.
  53.   8.6.1/8.6    93/10/08
  54.       Portability fixes for A/UX and Encore UMAX V.
  55.       Fix error message handling -- if you had a name server down
  56. *** cf/m4/proto.m4.OLD    Thu Oct 14 09:16:38 1993
  57. --- cf/m4/proto.m4    Fri Oct 15 08:35:24 1993
  58. ***************
  59. *** 34,40 ****
  60.   #
  61.   divert(0)
  62.   
  63. ! VERSIONID(`@(#)proto.m4    8.18 (Berkeley) 10/2/93')
  64.   
  65.   MAILER(local)dnl
  66.   
  67. --- 34,40 ----
  68.   #
  69.   divert(0)
  70.   
  71. ! VERSIONID(`@(#)proto.m4    8.19 (Berkeley) 10/15/93')
  72.   
  73.   MAILER(local)dnl
  74.   
  75. ***************
  76. *** 574,586 ****
  77.   ifdef(`_NO_UUCP_', `dnl',
  78.   `# resolve remotely connected UUCP links (if any)
  79.   ifdef(`_CLASS_V_',
  80. ! `R$* < @ $=V . UUCP > $*        $: $>_SET_95_ < $V > <@ $V> : $1 @ $2.UUCP $3',
  81.       `dnl')
  82.   ifdef(`_CLASS_W_',
  83. ! `R$* < @ $=W . UUCP > $*        $: $>_SET_95_ < $W > <@ $W> : $1 @ $2.UUCP $3',
  84.       `dnl')
  85.   ifdef(`_CLASS_X_',
  86. ! `R$* < @ $=X . UUCP > $*        $: $>_SET_95_ < $X > <@ $X> : $1 @ $2.UUCP $3',
  87.       `dnl')')
  88.   
  89.   # resolve fake top level domains by forwarding to other hosts
  90. --- 574,586 ----
  91.   ifdef(`_NO_UUCP_', `dnl',
  92.   `# resolve remotely connected UUCP links (if any)
  93.   ifdef(`_CLASS_V_',
  94. ! `R$* < @ $=V . UUCP > $*        $: $>_SET_95_ < $V > $1 <@$2.UUCP> $3',
  95.       `dnl')
  96.   ifdef(`_CLASS_W_',
  97. ! `R$* < @ $=W . UUCP > $*        $: $>_SET_95_ < $W > $1 <@$2.UUCP> $3',
  98.       `dnl')
  99.   ifdef(`_CLASS_X_',
  100. ! `R$* < @ $=X . UUCP > $*        $: $>_SET_95_ < $X > $1 <@$2.UUCP> $3',
  101.       `dnl')')
  102.   
  103.   # resolve fake top level domains by forwarding to other hosts
  104. ***************
  105. *** 598,604 ****
  106.   
  107.   ifdef(`UUCP_RELAY',
  108.   `# forward non-local UUCP traffic to our UUCP relay
  109. ! R$*<@$*.UUCP>$*        $: $>_SET_95_ < $Y > <@ $Y> : $1 @ $2.UUCP $3    uucp mail',
  110.   `ifdef(`_MAILER_uucp_',
  111.   `# forward other UUCP traffic straight to UUCP
  112.   R< @ $+ .UUCP > : $+    $#uucp $@ $1 $: $2        @host.UUCP:...
  113. --- 598,604 ----
  114.   
  115.   ifdef(`UUCP_RELAY',
  116.   `# forward non-local UUCP traffic to our UUCP relay
  117. ! R$*<@$*.UUCP>$*        $: $>_SET_95_ < $Y > $1 @ <$2.UUCP> $3    uucp mail',
  118.   `ifdef(`_MAILER_uucp_',
  119.   `# forward other UUCP traffic straight to UUCP
  120.   R< @ $+ .UUCP > : $+    $#uucp $@ $1 $: $2        @host.UUCP:...
  121. *** cf/m4/version.m4.OLD    Fri Oct 15 09:01:24 1993
  122. --- cf/m4/version.m4    Fri Oct 15 08:58:31 1993
  123. ***************
  124. *** 32,39 ****
  125.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  126.   # SUCH DAMAGE.
  127.   #
  128. ! VERSIONID(`@(#)version.m4    8.6 (Berkeley) 10/5/93')
  129.   #
  130.   divert(0)
  131.   # Configuration version number
  132. ! DZ8.6
  133. --- 32,39 ----
  134.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  135.   # SUCH DAMAGE.
  136.   #
  137. ! VERSIONID(`@(#)version.m4    8.6.1.2 (Berkeley) 10/15/93')
  138.   #
  139.   divert(0)
  140.   # Configuration version number
  141. ! DZ8.6.2
  142. *** src/Makefile.OSF1.OLD    Thu Oct 14 06:45:06 1993
  143. --- src/Makefile.OSF1    Fri Oct 15 08:17:06 1993
  144. ***************
  145. *** 5,11 ****
  146.   #  old make program (I recommend that you get and port the new make if you
  147.   #  are going to be doing any signficant work on sendmail).
  148.   #
  149. ! #  This has been tested on OSF/1 T1.3-4.
  150.   #
  151.   
  152.   # use O=-O (usual) or O=-g (debugging)
  153. --- 5,11 ----
  154.   #  old make program (I recommend that you get and port the new make if you
  155.   #  are going to be doing any signficant work on sendmail).
  156.   #
  157. ! #  This has been tested on OSF/1 1.3
  158.   #
  159.   
  160.   # use O=-O (usual) or O=-g (debugging)
  161. ***************
  162. *** 38,53 ****
  163.   BINDIR=    ${DESTDIR}/usr/sbin
  164.   
  165.   # location of sendmail.st file (usually /var/log or /usr/lib)
  166. ! STDIR=    ${DESTDIR}/var/log
  167.   
  168.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  169. ! HFDIR=    ${DESTDIR}/usr/share/misc
  170.   
  171.   # additional .o files needed
  172.   OBJADD=
  173.   
  174.   # additional link flags
  175. ! LDADD=    -non_shared
  176.   
  177.   ###################  end of user configuration flags  ######################
  178.   
  179. --- 38,53 ----
  180.   BINDIR=    ${DESTDIR}/usr/sbin
  181.   
  182.   # location of sendmail.st file (usually /var/log or /usr/lib)
  183. ! STDIR=    ${DESTDIR}/var/adm/sendmail
  184.   
  185.   # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  186. ! HFDIR=    ${DESTDIR}/usr/share/lib
  187.   
  188.   # additional .o files needed
  189.   OBJADD=
  190.   
  191.   # additional link flags
  192. ! LDADD=
  193.   
  194.   ###################  end of user configuration flags  ######################
  195.   
  196. ***************
  197. *** 59,65 ****
  198.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  199.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  200.   
  201. ! LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  202.   BINOWN=    root
  203.   BINGRP=    kmem
  204.   BINMODE=6555
  205. --- 59,65 ----
  206.       savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  207.       trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  208.   
  209. ! LINKS=    ${BINDIR}/newaliases ${BINDIR}/mailq
  210.   BINOWN=    root
  211.   BINGRP=    kmem
  212.   BINMODE=6555
  213. *** src/READ_ME.OLD    Tue Oct 12 15:38:34 1993
  214. --- src/READ_ME    Fri Oct 15 08:35:08 1993
  215. ***************
  216. *** 30,36 ****
  217.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  218.   # SUCH DAMAGE.
  219.   #
  220. ! #    @(#)READ_ME    8.28 (Berkeley) 10/8/93
  221.   #
  222.   
  223.   This directory contains the source files for sendmail.
  224. --- 30,36 ----
  225.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  226.   # SUCH DAMAGE.
  227.   #
  228. ! #    @(#)READ_ME    8.29 (Berkeley) 10/15/93
  229.   #
  230.   
  231.   This directory contains the source files for sendmail.
  232. ***************
  233. *** 66,72 ****
  234. --- 66,75 ----
  235.   2.4.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO
  236.   FAIL MISERABLY.
  237.   
  238. + IMPORTANT:  Read the appropriate paragraphs in the section on
  239. + ``Operating System and Compile Quirks''.
  240.   
  241.   +----------------------+
  242.   | DATABASE DEFINITIONS |
  243.   +----------------------+
  244. ***************
  245. *** 359,364 ****
  246. --- 362,410 ----
  247.       extern int opterr;
  248.       extern int optind;
  249.   
  250. + A/UX
  251. +     Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
  252. +     From: "Eric C. Hagberg" <hagberg@med.cornell.edu>
  253. +     Subject: Fix for A/UX ndbm
  254. +     I guess this isn't really a sendmail bug, however, it is something
  255. +     that A/UX users should be aware of when compiling sendmail 8.6.
  256. +     Apparently, the calls that sendmail is using to the ndbm routines
  257. +     in A/UX 3.0.x contain calls to "broken" routines, in that the
  258. +     aliases database will break when it gets "just a little big"
  259. +     (sorry I don't have exact numbers here, but it broke somewhere
  260. +     around 20-25 aliases for me.), making all aliases non-functional
  261. +     after exceeding this point.
  262. +     What I did was to get the gnu-dbm-1.6 package, compile it, and
  263. +     then re-compile sendmail with "-lgdbm", "-DNDBM", and using the
  264. +     ndbm.h header file that comes with the gnu-package. This makes
  265. +     things behave properly.
  266. +     I suppose porting the New Berkeley db package is another route,
  267. +     however, I made a quick attempt at it, and found it difficult
  268. +     (not easy at least); the gnu-dbm package "configured" and
  269. +     compiled easily.
  270. + DG/UX
  271. +     Apparently, /bin/mail doesn't work properly for delivery on
  272. +     DG/UX -- the person who has this working, Douglas Anderson
  273. +     <dlander@afterlife.ncsc.mil>, used procmail instead.
  274. + Non-DNS based sites
  275. +     This version of sendmail always tries to connect to the Domain
  276. +     Name System (DNS) to resolve names, regardless of the setting
  277. +     of the `I' option.  On most systems that are not running DNS,
  278. +     this will fail quickly and sendmail will continue, but on some
  279. +     systems it has a long timeout.  If you have this problem, you
  280. +     will have to recompile without NAMED_BIND.  Some people have
  281. +     claimed that they have successfully used "OI+USEVC" to force
  282. +     sendmail to use a virtual circuit -- this will always time out
  283. +     quickly, but also tells sendmail that a failed connection
  284. +     should requeue the message (probably not what you intended).
  285. +     A future release of sendmail will correct this problem.
  286.   Both NEWDB and NDBM
  287.       If you use both -DNDBM and -DNEWDB, you must delete the module
  288.       ndbm.o from libdb.a and delete the file "ndbm.h" from the files
  289. ***************
  290. *** 434,437 ****
  291.   
  292.   Eric Allman
  293.   
  294. ! (Version 8.28, last update 10/8/93 16:01:04)
  295. --- 480,483 ----
  296.   
  297.   Eric Allman
  298.   
  299. ! (Version 8.29, last update 10/15/93 08:34:06)
  300. *** src/alias.c.OLD    Fri Oct 15 05:40:30 1993
  301. --- src/alias.c    Fri Oct 15 08:35:20 1993
  302. ***************
  303. *** 36,42 ****
  304.   # include <pwd.h>
  305.   
  306.   #ifndef lint
  307. ! static char sccsid[] = "@(#)alias.c    8.16 (Berkeley) 9/25/93";
  308.   #endif /* not lint */
  309.   
  310.   
  311. --- 36,42 ----
  312.   # include <pwd.h>
  313.   
  314.   #ifndef lint
  315. ! static char sccsid[] = "@(#)alias.c    8.17 (Berkeley) 10/15/93";
  316.   #endif /* not lint */
  317.   
  318.   
  319. ***************
  320. *** 279,289 ****
  321.   **  ALIASWAIT -- wait for distinguished @:@ token to appear.
  322.   **
  323.   **    This can decide to reopen or rebuild the alias file
  324.   */
  325.   
  326. ! aliaswait(map, ext)
  327.       MAP *map;
  328.       char *ext;
  329.   {
  330.       int atcnt;
  331.       time_t mtime;
  332. --- 279,303 ----
  333.   **  ALIASWAIT -- wait for distinguished @:@ token to appear.
  334.   **
  335.   **    This can decide to reopen or rebuild the alias file
  336. + **
  337. + **    Parameters:
  338. + **        map -- a pointer to the map descriptor for this alias file.
  339. + **        ext -- the filename extension (e.g., ".db") for the
  340. + **            database file.
  341. + **        isopen -- if set, the database is already open, and we
  342. + **            should check for validity; otherwise, we are
  343. + **            just checking to see if it should be created.
  344. + **
  345. + **    Returns:
  346. + **        TRUE -- if the database is open when we return.
  347. + **        FALSE -- if the database is closed when we return.
  348.   */
  349.   
  350. ! bool
  351. ! aliaswait(map, ext, isopen)
  352.       MAP *map;
  353.       char *ext;
  354. +     int isopen;
  355.   {
  356.       int atcnt;
  357.       time_t mtime;
  358. ***************
  359. *** 302,308 ****
  360.       {
  361.           auto int st;
  362.   
  363. !         while (atcnt-- >= 0 &&
  364.                  map->map_class->map_lookup(map, "@", NULL, &st) == NULL)
  365.           {
  366.               /*
  367. --- 316,322 ----
  368.       {
  369.           auto int st;
  370.   
  371. !         while (isopen && atcnt-- >= 0 &&
  372.                  map->map_class->map_lookup(map, "@", NULL, &st) == NULL)
  373.           {
  374.               /*
  375. ***************
  376. *** 315,321 ****
  377.   
  378.               map->map_class->map_close(map);
  379.               sleep(30);
  380. !             map->map_class->map_open(map, O_RDONLY);
  381.           }
  382.       }
  383.   
  384. --- 329,335 ----
  385.   
  386.               map->map_class->map_close(map);
  387.               sleep(30);
  388. !             isopen = map->map_class->map_open(map, O_RDONLY);
  389.           }
  390.       }
  391.   
  392. ***************
  393. *** 325,331 ****
  394.           if (tTd(27, 3))
  395.               printf("aliaswait: not rebuildable\n");
  396.           map->map_mflags &= ~MF_ALIASWAIT;
  397. !         return;
  398.       }
  399.       if (stat(map->map_file, &stb) < 0)
  400.       {
  401. --- 339,345 ----
  402.           if (tTd(27, 3))
  403.               printf("aliaswait: not rebuildable\n");
  404.           map->map_mflags &= ~MF_ALIASWAIT;
  405. !         return isopen;
  406.       }
  407.       if (stat(map->map_file, &stb) < 0)
  408.       {
  409. ***************
  410. *** 332,338 ****
  411.           if (tTd(27, 3))
  412.               printf("aliaswait: no source file\n");
  413.           map->map_mflags &= ~MF_ALIASWAIT;
  414. !         return;
  415.       }
  416.       mtime = stb.st_mtime;
  417.       (void) strcpy(buf, map->map_file);
  418. --- 346,352 ----
  419.           if (tTd(27, 3))
  420.               printf("aliaswait: no source file\n");
  421.           map->map_mflags &= ~MF_ALIASWAIT;
  422. !         return isopen;
  423.       }
  424.       mtime = stb.st_mtime;
  425.       (void) strcpy(buf, map->map_file);
  426. ***************
  427. *** 344,350 ****
  428. --- 358,367 ----
  429.           if (AutoRebuild && stb.st_ino != 0 && stb.st_uid == geteuid())
  430.           {
  431.               message("auto-rebuilding alias database %s", buf);
  432. +             if (isopen)
  433. +                 map->map_class->map_close(map);
  434.               rebuildaliases(map, TRUE);
  435. +             isopen = map->map_class->map_open(map, O_RDONLY);
  436.           }
  437.           else
  438.           {
  439. ***************
  440. *** 357,362 ****
  441. --- 374,380 ----
  442.           }
  443.       }
  444.       map->map_mflags &= ~MF_ALIASWAIT;
  445. +     return isopen;
  446.   }
  447.    /*
  448.   **  REBUILDALIASES -- rebuild the alias database.
  449. *** src/collect.c.OLD    Thu Oct 14 07:54:22 1993
  450. --- src/collect.c    Fri Oct 15 08:35:10 1993
  451. ***************
  452. *** 33,39 ****
  453.    */
  454.   
  455.   #ifndef lint
  456. ! static char sccsid[] = "@(#)collect.c    8.4 (Berkeley) 8/6/93";
  457.   #endif /* not lint */
  458.   
  459.   # include <errno.h>
  460. --- 33,39 ----
  461.    */
  462.   
  463.   #ifndef lint
  464. ! static char sccsid[] = "@(#)collect.c    8.5 (Berkeley) 10/15/93";
  465.   #endif /* not lint */
  466.   
  467.   # include <errno.h>
  468. ***************
  469. *** 72,77 ****
  470. --- 72,78 ----
  471.       bool ignrdot = smtpmode ? FALSE : IgnrDot;
  472.       char buf[MAXLINE], buf2[MAXLINE];
  473.       register char *workbuf, *freebuf;
  474. +     bool inputerr = FALSE;
  475.       extern char *hvalue();
  476.       extern bool isheader(), flusheol();
  477.   
  478. ***************
  479. *** 245,251 ****
  480.       **  Collect the body of the message.
  481.       */
  482.   
  483. !     do
  484.       {
  485.           register char *bp = buf;
  486.   
  487. --- 246,252 ----
  488.       **  Collect the body of the message.
  489.       */
  490.   
  491. !     for (;;)
  492.       {
  493.           register char *bp = buf;
  494.   
  495. ***************
  496. *** 269,278 ****
  497.           fputs("\n", tf);
  498.           if (ferror(tf))
  499.               tferror(tf, e);
  500. !     } while (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
  501. !             "message body read") != NULL);
  502.   
  503.   readerr:
  504.       if (fflush(tf) != 0)
  505.           tferror(tf, e);
  506.       (void) fsync(fileno(tf));
  507. --- 270,286 ----
  508.           fputs("\n", tf);
  509.           if (ferror(tf))
  510.               tferror(tf, e);
  511. !         if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
  512. !                 "message body read") == NULL)
  513. !             goto readerr;
  514. !     }
  515.   
  516. +     if (feof(InChannel) || ferror(InChannel))
  517. +     {
  518.   readerr:
  519. +         inputerr = TRUE;
  520. +     }
  521.       if (fflush(tf) != 0)
  522.           tferror(tf, e);
  523.       (void) fsync(fileno(tf));
  524. ***************
  525. *** 279,301 ****
  526.       (void) fclose(tf);
  527.   
  528.       /* An EOF when running SMTP is an error */
  529. !     if ((feof(InChannel) || ferror(InChannel)) && OpMode == MD_SMTP)
  530.       {
  531.           char *host;
  532.   
  533.           host = RealHostName;
  534.           if (host == NULL)
  535.               host = "localhost";
  536.   
  537.   # ifdef LOG
  538.           if (LogLevel > 0 && feof(InChannel))
  539.               syslog(LOG_NOTICE,
  540. !                 "collect: unexpected close on connection from %s, sender=%s: %m\n",
  541. !                 host, e->e_from.q_paddr);
  542.   # endif
  543.           (feof(InChannel) ? usrerr : syserr)
  544. !             ("451 collect: unexpected close on connection from %s, from=%s",
  545. !                 host, e->e_from.q_paddr);
  546.   
  547.           /* don't return an error indication */
  548.           e->e_to = NULL;
  549. --- 287,316 ----
  550.       (void) fclose(tf);
  551.   
  552.       /* An EOF when running SMTP is an error */
  553. !     if (inputerr && OpMode == MD_SMTP)
  554.       {
  555.           char *host;
  556. +         char *problem;
  557.   
  558.           host = RealHostName;
  559.           if (host == NULL)
  560.               host = "localhost";
  561.   
  562. +         if (feof(InChannel))
  563. +             problem = "unexpected close";
  564. +         else if (ferror(InChannel))
  565. +             problem = "I/O error";
  566. +         else
  567. +             problem = "read timeout";
  568.   # ifdef LOG
  569.           if (LogLevel > 0 && feof(InChannel))
  570.               syslog(LOG_NOTICE,
  571. !                 "collect: %s on connection from %s, sender=%s: %m\n",
  572. !                 problem, host, e->e_from.q_paddr);
  573.   # endif
  574.           (feof(InChannel) ? usrerr : syserr)
  575. !             ("451 collect: %s on connection from %s, from=%s",
  576. !                 problem, host, e->e_from.q_paddr);
  577.   
  578.           /* don't return an error indication */
  579.           e->e_to = NULL;
  580. ***************
  581. *** 303,308 ****
  582. --- 318,325 ----
  583.           e->e_flags |= EF_CLRQUEUE;
  584.   
  585.           /* and don't try to deliver the partial message either */
  586. +         if (InChild)
  587. +             ExitStat = EX_QUIT;
  588.           finis();
  589.       }
  590.   
  591. *** src/conf.c.OLD    Tue Oct 12 06:45:47 1993
  592. --- src/conf.c    Fri Oct 15 08:35:19 1993
  593. ***************
  594. *** 33,39 ****
  595.    */
  596.   
  597.   #ifndef lint
  598. ! static char sccsid[] = "@(#)conf.c    8.40 (Berkeley) 10/8/93";
  599.   #endif /* not lint */
  600.   
  601.   # include "sendmail.h"
  602. --- 33,39 ----
  603.    */
  604.   
  605.   #ifndef lint
  606. ! static char sccsid[] = "@(#)conf.c    8.41 (Berkeley) 10/15/93";
  607.   #endif /* not lint */
  608.   
  609.   # include "sendmail.h"
  610. ***************
  611. *** 756,761 ****
  612. --- 756,777 ----
  613.   #else
  614.   #if LA_TYPE == LA_SUBR
  615.   
  616. + #ifdef DGUX
  617. + #include <sys/dg_sys_info.h>
  618. + int getla()
  619. + {
  620. +     struct dg_sys_info_load_info load_info;
  621. +     dg_sys_info((long *)&load_info,
  622. +         DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
  623. +     return((int) (load_info.one_minute + 0.5));
  624. + }
  625. + #else
  626.   getla()
  627.   {
  628.       double avenrun[3];
  629. ***************
  630. *** 771,776 ****
  631. --- 787,793 ----
  632.       return ((int) (avenrun[0] + 0.5));
  633.   }
  634.   
  635. + #endif /* DGUX */
  636.   #else
  637.   #if LA_TYPE == LA_MACH
  638.   
  639. ***************
  640. *** 1191,1196 ****
  641. --- 1208,1235 ----
  642.   
  643.   #endif
  644.    /*
  645. + **  DGUX_INET_ADDR -- inet_addr for DG/UX
  646. + **
  647. + **    Data General DG/UX version of inet_addr returns a struct in_addr
  648. + **    instead of a long.  This patches things.
  649. + */
  650. + #ifdef DGUX
  651. + #undef inet_addr
  652. + long
  653. + dgux_inet_addr(host)
  654. +     char *host;
  655. + {
  656. +     struct in_addr haddr;
  657. +     haddr = inet_addr(host);
  658. +     return haddr.s_addr;
  659. + }
  660. + #endif
  661. +  /*
  662.   **  GETOPT -- for old systems or systems with bogus implementations
  663.   */
  664.   
  665. ***************
  666. *** 1341,1347 ****
  667.   #endif
  668.   
  669.   #ifdef HASSTATFS
  670. ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV)
  671.   #  include <sys/statfs.h>
  672.   # else
  673.   #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE)
  674. --- 1380,1386 ----
  675.   #endif
  676.   
  677.   #ifdef HASSTATFS
  678. ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX)
  679.   #  include <sys/statfs.h>
  680.   # else
  681.   #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE)
  682. ***************
  683. *** 1381,1387 ****
  684.   # if defined(HASUSTAT)
  685.       if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
  686.   # else
  687. ! #  if defined(IRIX) || defined(apollo) || defined(UMAXV)
  688.       if (statfs(dir, &fs, sizeof fs, 0) == 0)
  689.   #  else
  690.   #   if defined(ultrix)
  691. --- 1420,1426 ----
  692.   # if defined(HASUSTAT)
  693.       if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
  694.   # else
  695. ! #  if defined(IRIX) || defined(apollo) || defined(UMAXV) || defined(DGUX)
  696.       if (statfs(dir, &fs, sizeof fs, 0) == 0)
  697.   #  else
  698.   #   if defined(ultrix)
  699. ***************
  700. *** 1686,1689 ****
  701. --- 1725,1745 ----
  702.       if (ConfFile != NULL)
  703.           return ConfFile;
  704.       return _PATH_SENDMAILCF;
  705. + }
  706. +  /*
  707. + **  SETVENDOR -- process vendor code from V configuration line
  708. + **
  709. + **    Parameters:
  710. + **        vendor -- string representation of vendor.
  711. + **
  712. + **    Returns:
  713. + **        TRUE -- if ok.
  714. + **        FALSE -- if vendor code could not be processed.
  715. + */
  716. + bool
  717. + setvendor(vendor)
  718. +     char *vendor;
  719. + {
  720. +     return (strcasecmp(vendor, "Berkeley") == 0);
  721.   }
  722. *** src/conf.h.OLD    Tue Oct 12 06:46:10 1993
  723. --- src/conf.h    Fri Oct 15 08:35:10 1993
  724. ***************
  725. *** 31,37 ****
  726.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  727.    * SUCH DAMAGE.
  728.    *
  729. !  *    @(#)conf.h    8.37 (Berkeley) 10/8/93
  730.    */
  731.   
  732.   /*
  733. --- 31,37 ----
  734.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  735.    * SUCH DAMAGE.
  736.    *
  737. !  *    @(#)conf.h    8.38 (Berkeley) 10/15/93
  738.    */
  739.   
  740.   /*
  741. ***************
  742. *** 191,197 ****
  743. --- 191,216 ----
  744.   # endif
  745.   #endif
  746.   
  747. + /*
  748. + ** DG/UX 5.4.2
  749. + */
  750.   
  751. + #ifdef    DGUX
  752. + # define SYSTEM5    1
  753. + # define LA_TYPE    LA_SUBR
  754. + # define HASSTATFS    1    /* has the statfs(2) syscall */
  755. + # define HASSETREUID    1    /* has setreuid(2) call */
  756. + # define HASUNAME    1    /* use System V uname(2) system call */
  757. + # define HASSETSID    1    /* has Posix setsid(2) call */
  758. + # define HASINITGROUPS    1    /* has initgroups(3) call */
  759. + # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  760. + # undef IDENTPROTO        /* TCP/IP implementation is broken */
  761. + # undef SETPROCTITLE
  762. + # define inet_addr    dgux_inet_addr
  763. + extern long    dgux_inet_addr();
  764. + #endif
  765.   /*
  766.   **  Digital Ultrix 4.2A or 4.3
  767.   **
  768. ***************
  769. *** 302,308 ****
  770.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  771.   # define FORK        fork
  772.   # define MAXPATHLEN    PATHSIZE
  773. ! # define LA_TYPE    LA_ZERO
  774.   #endif
  775.   
  776.   
  777. --- 321,327 ----
  778.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  779.   # define FORK        fork
  780.   # define MAXPATHLEN    PATHSIZE
  781. ! # define LA_TYPE    LA_SHORT
  782.   #endif
  783.   
  784.   
  785. ***************
  786. *** 385,390 ****
  787. --- 404,410 ----
  788.   # define HASUSTAT    1    /* use System V ustat(2) syscall */
  789.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  790.   # define SIGFUNC_DEFINED    /* sigfunc_t already defined */
  791. + # undef IDENTPROTO        /* TCP/IP implementation is broken */
  792.   # define FORK        fork
  793.   # ifndef _PATH_SENDMAILCF
  794.   #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  795. ***************
  796. *** 457,464 ****
  797.   
  798.   /* general POSIX defines */
  799.   #ifdef _POSIX_VERSION
  800. ! # define HASSETSID    1    /* has setsid(2) call */
  801. ! # define HASWAITPID    1    /* has waitpid(2) call */
  802.   #endif
  803.   
  804.   /*
  805. --- 477,484 ----
  806.   
  807.   /* general POSIX defines */
  808.   #ifdef _POSIX_VERSION
  809. ! # define HASSETSID    1    /* has Posix setsid(2) call */
  810. ! # define HASWAITPID    1    /* has Posix waitpid(2) call */
  811.   #endif
  812.   
  813.   /*
  814. ***************
  815. *** 497,502 ****
  816. --- 517,526 ----
  817.   # ifndef EX_CONFIG
  818.   # define EX_CONFIG    78    /* configuration error */
  819.   # endif
  820. + /* pseudo-code used in server SMTP */
  821. + # define EX_QUIT    22    /* drop out of server immediately */
  822.   
  823.   /*
  824.   **  These are used in a few cases where we need some special
  825. *** src/deliver.c.OLD    Sat Oct  9 08:05:12 1993
  826. --- src/deliver.c    Fri Oct 15 08:35:18 1993
  827. ***************
  828. *** 33,39 ****
  829.    */
  830.   
  831.   #ifndef lint
  832. ! static char sccsid[] = "@(#)deliver.c    8.30 (Berkeley) 10/8/93";
  833.   #endif /* not lint */
  834.   
  835.   #include "sendmail.h"
  836. --- 33,39 ----
  837.    */
  838.   
  839.   #ifndef lint
  840. ! static char sccsid[] = "@(#)deliver.c    8.31 (Berkeley) 10/15/93";
  841.   #endif /* not lint */
  842.   
  843.   #include "sendmail.h"
  844. ***************
  845. *** 592,597 ****
  846. --- 592,598 ----
  847.       char rpathbuf[MAXNAME];        /* translated return path */
  848.       extern int checkcompat();
  849.       extern FILE *fdopen();
  850. +     extern char SmtpError[];
  851.   
  852.       errno = 0;
  853.       if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags))
  854. ***************
  855. *** 609,614 ****
  856. --- 610,616 ----
  857.       host = to->q_host;
  858.       CurEnv = e;            /* just in case */
  859.       e->e_statmsg = NULL;
  860. +     SmtpError[0] = '\0';
  861.   
  862.       if (tTd(10, 1))
  863.           printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n",
  864. ***************
  865. *** 719,725 ****
  866.           *pvp = NULL;
  867.   # else /* SMTP */
  868.           /* oops!  we don't implement SMTP */
  869. !         syserr("554 SMTP style mailer");
  870.           return (EX_SOFTWARE);
  871.   # endif /* SMTP */
  872.       }
  873. --- 721,727 ----
  874.           *pvp = NULL;
  875.   # else /* SMTP */
  876.           /* oops!  we don't implement SMTP */
  877. !         syserr("554 SMTP style mailer not implemented");
  878.           return (EX_SOFTWARE);
  879.   # endif /* SMTP */
  880.       }
  881. ***************
  882. *** 929,934 ****
  883. --- 931,937 ----
  884.   
  885.       curhost = NULL;
  886.       SmtpPhase = NULL;
  887. +     mci = NULL;
  888.   
  889.   #ifdef XDEBUG
  890.       {
  891. ***************
  892. *** 940,946 ****
  893.       }
  894.   #endif
  895.   
  896.       /* check for Local Person Communication -- not for mortals!!! */
  897.       if (strcmp(m->m_mailer, "[LPC]") == 0)
  898.       {
  899. --- 943,948 ----
  900. ***************
  901. *** 971,977 ****
  902.           if (!clever)
  903.           {
  904.               syserr("554 non-clever IPC");
  905. !             rcode = EX_OSERR;
  906.               goto give_up;
  907.           }
  908.           if (pv[2] != NULL)
  909. --- 973,979 ----
  910.           if (!clever)
  911.           {
  912.               syserr("554 non-clever IPC");
  913. !             rcode = EX_CONFIG;
  914.               goto give_up;
  915.           }
  916.           if (pv[2] != NULL)
  917. ***************
  918. *** 979,996 ****
  919.           else
  920.               port = 0;
  921.   tryhost:
  922. -         mci = NULL;
  923.           while (*curhost != '\0')
  924.           {
  925.               register char *p;
  926.               static char hostbuf[MAXNAME];
  927.   
  928. -             mci = NULL;
  929.               /* pull the next host from the signature */
  930.               p = strchr(curhost, ':');
  931.               if (p == NULL)
  932.                   p = &curhost[strlen(curhost)];
  933.               strncpy(hostbuf, curhost, p - curhost);
  934.               hostbuf[p - curhost] = '\0';
  935.               if (*p != '\0')
  936. --- 981,1000 ----
  937.           else
  938.               port = 0;
  939.   tryhost:
  940.           while (*curhost != '\0')
  941.           {
  942.               register char *p;
  943.               static char hostbuf[MAXNAME];
  944.   
  945.               /* pull the next host from the signature */
  946.               p = strchr(curhost, ':');
  947.               if (p == NULL)
  948.                   p = &curhost[strlen(curhost)];
  949. +             if (p == curhost)
  950. +             {
  951. +                 syserr("deliver: null host name in signature");
  952. +                 continue;
  953. +             }
  954.               strncpy(hostbuf, curhost, p - curhost);
  955.               hostbuf[p - curhost] = '\0';
  956.               if (*p != '\0')
  957. ***************
  958. *** 1038,1053 ****
  959.                   printf("openmailer: makeconnection => stat=%d, errno=%d\n",
  960.                       i, errno);
  961.   
  962.               /* enter status of this host */
  963.               setstat(i);
  964.           }
  965.           mci->mci_pid = 0;
  966.   #else /* no DAEMON */
  967.           syserr("554 openmailer: no IPC");
  968.           if (tTd(11, 1))
  969.               printf("openmailer: NULL\n");
  970. !         return NULL;
  971.   #endif /* DAEMON */
  972.       }
  973.       else
  974. --- 1042,1065 ----
  975.                   printf("openmailer: makeconnection => stat=%d, errno=%d\n",
  976.                       i, errno);
  977.   
  978.               /* enter status of this host */
  979.               setstat(i);
  980. +             /* should print some message here for -v mode */
  981.           }
  982. +         if (mci == NULL)
  983. +         {
  984. +             syserr("deliver: no host name");
  985. +             rcode = EX_OSERR;
  986. +             goto give_up;
  987. +         }
  988.           mci->mci_pid = 0;
  989.   #else /* no DAEMON */
  990.           syserr("554 openmailer: no IPC");
  991.           if (tTd(11, 1))
  992.               printf("openmailer: NULL\n");
  993. !         rcode = EX_UNAVAILABLE;
  994. !         goto give_up;
  995.   #endif /* DAEMON */
  996.       }
  997.       else
  998. ***************
  999. *** 1388,1394 ****
  1000.   #endif
  1001.   
  1002.       /* arrange a return receipt if requested */
  1003. !     if (e->e_receiptto != NULL && bitnset(M_LOCALMAILER, m->m_flags))
  1004.       {
  1005.           e->e_flags |= EF_SENDRECEIPT;
  1006.           /* do we want to send back more info? */
  1007. --- 1400,1407 ----
  1008.   #endif
  1009.   
  1010.       /* arrange a return receipt if requested */
  1011. !     if (rcode == EX_OK && e->e_receiptto != NULL &&
  1012. !         bitnset(M_LOCALMAILER, m->m_flags))
  1013.       {
  1014.           e->e_flags |= EF_SENDRECEIPT;
  1015.           /* do we want to send back more info? */
  1016. ***************
  1017. *** 1412,1417 ****
  1018. --- 1425,1436 ----
  1019.           {
  1020.               to->q_flags |= QSENT;
  1021.               e->e_nsent++;
  1022. +             if (e->e_receiptto != NULL &&
  1023. +                 bitnset(M_LOCALMAILER, m->m_flags))
  1024. +             {
  1025. +                 fprintf(e->e_xfp, "%s... Successfully delivered\n",
  1026. +                     to->q_paddr);
  1027. +             }
  1028.           }
  1029.       }
  1030.   
  1031. ***************
  1032. *** 1641,1647 ****
  1033. --- 1660,1672 ----
  1034.       */
  1035.   
  1036.       if (stat == EX_OK || stat == EX_TEMPFAIL)
  1037. +     {
  1038. +         extern char MsgBuf[];
  1039.           message(&statmsg[4], errstring(errno));
  1040. +         if (stat == EX_TEMPFAIL && e->e_xfp != NULL)
  1041. +             fprintf(e->e_xfp, "%s\n", &MsgBuf[4]);
  1042. +     }
  1043.       else
  1044.       {
  1045.           Errors++;
  1046. ***************
  1047. *** 1853,1859 ****
  1048.   
  1049.           if (ferror(e->e_dfp))
  1050.           {
  1051. !             syserr("putbody: read error");
  1052.               ExitStat = EX_IOERR;
  1053.           }
  1054.       }
  1055. --- 1878,1884 ----
  1056.   
  1057.           if (ferror(e->e_dfp))
  1058.           {
  1059. !             syserr("putbody: %s: read error", e->e_df);
  1060.               ExitStat = EX_IOERR;
  1061.           }
  1062.       }
  1063. *** src/main.c.OLD    Tue Oct 12 13:18:02 1993
  1064. --- src/main.c    Fri Oct 15 08:35:09 1993
  1065. ***************
  1066. *** 39,45 ****
  1067.   #endif /* not lint */
  1068.   
  1069.   #ifndef lint
  1070. ! static char sccsid[] = "@(#)main.c    8.29 (Berkeley) 10/8/93";
  1071.   #endif /* not lint */
  1072.   
  1073.   #define    _DEFINE
  1074. --- 39,45 ----
  1075.   #endif /* not lint */
  1076.   
  1077.   #ifndef lint
  1078. ! static char sccsid[] = "@(#)main.c    8.30 (Berkeley) 10/15/93";
  1079.   #endif /* not lint */
  1080.   
  1081.   #define    _DEFINE
  1082. ***************
  1083. *** 99,104 ****
  1084. --- 99,105 ----
  1085.                   /* saved user environment */
  1086.   char        RealUserName[256];    /* the actual user id on this host */
  1087.   char        *CommandLineArgs;    /* command line args for pid file */
  1088. + bool        Warn_Q_option = FALSE;    /* warn about Q option use */
  1089.   
  1090.   /*
  1091.   **  Pointers for setproctitle.
  1092. ***************
  1093. *** 136,141 ****
  1094. --- 137,144 ----
  1095.       int j;
  1096.       bool queuemode = FALSE;        /* process queue requests */
  1097.       bool safecf = TRUE;
  1098. +     bool warn_C_flag = FALSE;
  1099. +     char warn_f_flag = '\0';
  1100.       static bool reenter = FALSE;
  1101.       char *argv0 = argv[0];
  1102.       struct passwd *pw;
  1103. ***************
  1104. *** 450,458 ****
  1105.   
  1106.             case 'C':    /* select configuration file (already done) */
  1107.               if (RealUid != 0)
  1108. !                 auth_warning(CurEnv,
  1109. !                     "Processed by %s with -C %s",
  1110. !                     RealUserName, optarg);
  1111.               ConfFile = optarg;
  1112.               (void) setgid(RealGid);
  1113.               (void) setuid(RealUid);
  1114. --- 453,459 ----
  1115.   
  1116.             case 'C':    /* select configuration file (already done) */
  1117.               if (RealUid != 0)
  1118. !                 warn_C_flag = TRUE;
  1119.               ConfFile = optarg;
  1120.               (void) setgid(RealGid);
  1121.               (void) setuid(RealUid);
  1122. ***************
  1123. *** 472,480 ****
  1124.               }
  1125.               from = newstr(optarg);
  1126.               if (strcmp(RealUserName, from) != 0)
  1127. !                 auth_warning(CurEnv,
  1128. !                     "%s set sender to %s using -%c",
  1129. !                     RealUserName, from, j);
  1130.               break;
  1131.   
  1132.             case 'F':    /* set full name */
  1133. --- 473,479 ----
  1134.               }
  1135.               from = newstr(optarg);
  1136.               if (strcmp(RealUserName, from) != 0)
  1137. !                 warn_f_flag = j;
  1138.               break;
  1139.   
  1140.             case 'F':    /* set full name */
  1141. ***************
  1142. *** 617,622 ****
  1143. --- 616,634 ----
  1144.           xputs(macvalue('k', CurEnv));
  1145.           printf("\n");
  1146.       }
  1147. +     /*
  1148. +     **  Process authorization warnings from command line.
  1149. +     */
  1150. +     if (warn_C_flag)
  1151. +         auth_warning(CurEnv, "Processed by %s with -C %s",
  1152. +             RealUserName, ConfFile);
  1153. +     if (warn_f_flag != '\0')
  1154. +         auth_warning(CurEnv, "%s set sender to %s using -%c",
  1155. +             RealUserName, from, warn_f_flag);
  1156. +     if (Warn_Q_option)
  1157. +         auth_warning(CurEnv, "Processed from queue %s", QueueDir);
  1158.   
  1159.       /* Enforce use of local time (null string overrides this) */
  1160.       if (TimeZoneSpec == NULL)
  1161. *** src/map.c.OLD    Thu Oct 14 19:25:28 1993
  1162. --- src/map.c    Fri Oct 15 08:35:20 1993
  1163. ***************
  1164. *** 33,39 ****
  1165.    */
  1166.   
  1167.   #ifndef lint
  1168. ! static char sccsid[] = "@(#)map.c    8.16 (Berkeley) 10/1/93";
  1169.   #endif /* not lint */
  1170.   
  1171.   #include "sendmail.h"
  1172. --- 33,39 ----
  1173.    */
  1174.   
  1175.   #ifndef lint
  1176. ! static char sccsid[] = "@(#)map.c    8.17 (Berkeley) 10/15/93";
  1177.   #endif /* not lint */
  1178.   
  1179.   #include "sendmail.h"
  1180. ***************
  1181. *** 85,90 ****
  1182. --- 85,92 ----
  1183.   */
  1184.   
  1185.   #define DBMMODE        0644
  1186. + extern bool    aliaswait __P((MAP *, char *, int));
  1187.    /*
  1188.   **  MAP_PARSEARGS -- parse config line arguments for database lookup
  1189.   **
  1190. ***************
  1191. *** 423,428 ****
  1192. --- 425,434 ----
  1193.       dbm = dbm_open(map->map_file, mode, DBMMODE);
  1194.       if (dbm == NULL)
  1195.       {
  1196. + #ifdef MAYBENEXTRELEASE
  1197. +         if (aliaswait(map, ".pag", FALSE))
  1198. +             return TRUE;
  1199. + #endif
  1200.           if (!bitset(MF_OPTIONAL, map->map_mflags))
  1201.               syserr("Cannot open DBM database %s", map->map_file);
  1202.           return FALSE;
  1203. ***************
  1204. *** 429,436 ****
  1205.       }
  1206.       map->map_db1 = (void *) dbm;
  1207.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1208. !         aliaswait(map, ".pag");
  1209. !     if (fstat(dbm_dirfno(dbm), &st) >= 0)
  1210.           map->map_mtime = st.st_mtime;
  1211.       return TRUE;
  1212.   }
  1213. --- 435,443 ----
  1214.       }
  1215.       map->map_db1 = (void *) dbm;
  1216.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1217. !         if (!aliaswait(map, ".pag", TRUE))
  1218. !             return FALSE;
  1219. !     if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
  1220.           map->map_mtime = st.st_mtime;
  1221.       return TRUE;
  1222.   }
  1223. ***************
  1224. *** 621,626 ****
  1225. --- 628,637 ----
  1226.       db = dbopen(buf, omode, DBMMODE, DB_BTREE, NULL);
  1227.       if (db == NULL)
  1228.       {
  1229. + #ifdef MAYBENEXTRELEASE
  1230. +         if (aliaswait(map, ".db", FALSE))
  1231. +             return TRUE;
  1232. + #endif
  1233.           if (!bitset(MF_OPTIONAL, map->map_mflags))
  1234.               syserr("Cannot open BTREE database %s", map->map_file);
  1235.           return FALSE;
  1236. ***************
  1237. *** 654,660 ****
  1238.   
  1239.       map->map_db2 = (void *) db;
  1240.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1241. !         aliaswait(map, ".db");
  1242.       return TRUE;
  1243.   }
  1244.   
  1245. --- 665,672 ----
  1246.   
  1247.       map->map_db2 = (void *) db;
  1248.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1249. !         if (!aliaswait(map, ".db", TRUE))
  1250. !             return FALSE;
  1251.       return TRUE;
  1252.   }
  1253.   
  1254. ***************
  1255. *** 700,705 ****
  1256. --- 712,721 ----
  1257.       db = dbopen(buf, omode, DBMMODE, DB_HASH, NULL);
  1258.       if (db == NULL)
  1259.       {
  1260. + #ifdef MAYBENEXTRELEASE
  1261. +         if (aliaswait(map, ".db", FALSE))
  1262. +             return TRUE;
  1263. + #endif
  1264.           if (!bitset(MF_OPTIONAL, map->map_mflags))
  1265.               syserr("Cannot open HASH database %s", map->map_file);
  1266.           return FALSE;
  1267. ***************
  1268. *** 733,739 ****
  1269.   
  1270.       map->map_db2 = (void *) db;
  1271.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1272. !         aliaswait(map, ".db");
  1273.       return TRUE;
  1274.   }
  1275.   
  1276. --- 749,756 ----
  1277.   
  1278.       map->map_db2 = (void *) db;
  1279.       if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
  1280. !         if (!aliaswait(map, ".db", TRUE))
  1281. !             return FALSE;
  1282.       return TRUE;
  1283.   }
  1284.   
  1285. ***************
  1286. *** 1185,1195 ****
  1287.       struct stat stb;
  1288.   
  1289.       if (tTd(38, 2))
  1290. !         printf("impl_map_open(%s)\n", map->map_file);
  1291.   
  1292.       if (stat(map->map_file, &stb) < 0)
  1293.       {
  1294.           /* no alias file at all */
  1295.           return FALSE;
  1296.       }
  1297.   
  1298. --- 1202,1214 ----
  1299.       struct stat stb;
  1300.   
  1301.       if (tTd(38, 2))
  1302. !         printf("impl_map_open(%s, %d)\n", map->map_file, mode);
  1303.   
  1304.       if (stat(map->map_file, &stb) < 0)
  1305.       {
  1306.           /* no alias file at all */
  1307. +         if (tTd(38, 3))
  1308. +             printf("no map file\n");
  1309.           return FALSE;
  1310.       }
  1311.   
  1312. *** src/readcf.c.OLD    Tue Oct 12 14:40:28 1993
  1313. --- src/readcf.c    Fri Oct 15 08:35:16 1993
  1314. ***************
  1315. *** 33,39 ****
  1316.    */
  1317.   
  1318.   #ifndef lint
  1319. ! static char sccsid[] = "@(#)readcf.c    8.12 (Berkeley) 9/5/93";
  1320.   #endif /* not lint */
  1321.   
  1322.   # include "sendmail.h"
  1323. --- 33,39 ----
  1324.    */
  1325.   
  1326.   #ifndef lint
  1327. ! static char sccsid[] = "@(#)readcf.c    8.13 (Berkeley) 10/15/93";
  1328.   #endif /* not lint */
  1329.   
  1330.   # include "sendmail.h"
  1331. ***************
  1332. *** 70,76 ****
  1333.   **                Args specify mailer parameters.
  1334.   **        Oxvalue        Set option x to value.
  1335.   **        Pname=value    Set precedence name to value.
  1336. ! **        Vversioncode    Version level of configuration syntax.
  1337.   **        Kmapname mapclass arguments....
  1338.   **                Define keyed lookup of a given class.
  1339.   **                Arguments are class dependent.
  1340. --- 70,78 ----
  1341.   **                Args specify mailer parameters.
  1342.   **        Oxvalue        Set option x to value.
  1343.   **        Pname=value    Set precedence name to value.
  1344. ! **        Vversioncode[/vendorcode]
  1345. ! **                Version level/vendor name of
  1346. ! **                configuration syntax.
  1347.   **        Kmapname mapclass arguments....
  1348.   **                Define keyed lookup of a given class.
  1349.   **                Arguments are class dependent.
  1350. ***************
  1351. *** 98,103 ****
  1352. --- 100,106 ----
  1353.       char *q;
  1354.       struct rewrite *rwp = NULL;
  1355.       char *bp;
  1356. +     auto char *ep;
  1357.       int nfuzzy;
  1358.       char *file;
  1359.       bool optional;
  1360. ***************
  1361. *** 205,210 ****
  1362. --- 208,214 ----
  1363.           }
  1364.   
  1365.           /* interpret this line */
  1366. +         errno = 0;
  1367.           switch (bp[0])
  1368.           {
  1369.             case '\0':
  1370. ***************
  1371. *** 492,498 ****
  1372.                       &bp[1]);
  1373.                   break;
  1374.               }
  1375. !             ConfigLevel = atoi(p);
  1376.               if (ConfigLevel >= 5)
  1377.               {
  1378.                   /* level 5 configs have short name in $w */
  1379. --- 496,502 ----
  1380.                       &bp[1]);
  1381.                   break;
  1382.               }
  1383. !             ConfigLevel = strtol(p, &ep, 10);
  1384.               if (ConfigLevel >= 5)
  1385.               {
  1386.                   /* level 5 configs have short name in $w */
  1387. ***************
  1388. *** 500,505 ****
  1389. --- 504,520 ----
  1390.                   if (p != NULL && (p = strchr(p, '.')) != NULL)
  1391.                       *p = '\0';
  1392.               }
  1393. +             if (*ep++ == '/')
  1394. +             {
  1395. +                 /* extract vendor code */
  1396. +                 for (p = ep; isascii(*p) && isalpha(*p); )
  1397. +                     p++;
  1398. +                 *p = '\0';
  1399. +                 if (!setvendor(ep))
  1400. +                     syserr("invalid V line vendor code: \"%s\"",
  1401. +                         ep);
  1402. +             }
  1403.               break;
  1404.   
  1405.             case 'K':
  1406. ***************
  1407. *** 1022,1027 ****
  1408. --- 1037,1043 ----
  1409.       extern time_t convtime();
  1410.       extern int QueueLA;
  1411.       extern int RefuseLA;
  1412. +     extern bool Warn_Q_option;
  1413.       extern bool trusteduser();
  1414.   
  1415.       if (tTd(37, 1))
  1416. ***************
  1417. *** 1334,1340 ****
  1418.           else
  1419.               QueueDir = newstr(val);
  1420.           if (RealUid != 0 && !safe)
  1421. !             auth_warning(e, "Processed from queue %s", QueueDir);
  1422.           break;
  1423.   
  1424.         case 'R':        /* don't prune routes */
  1425. --- 1350,1356 ----
  1426.           else
  1427.               QueueDir = newstr(val);
  1428.           if (RealUid != 0 && !safe)
  1429. !             Warn_Q_option = TRUE;
  1430.           break;
  1431.   
  1432.         case 'R':        /* don't prune routes */
  1433. *** src/savemail.c.OLD    Wed Oct 13 15:49:35 1993
  1434. --- src/savemail.c    Fri Oct 15 08:35:15 1993
  1435. ***************
  1436. *** 33,39 ****
  1437.    */
  1438.   
  1439.   #ifndef lint
  1440. ! static char sccsid[] = "@(#)savemail.c    8.13 (Berkeley) 9/26/93";
  1441.   #endif /* not lint */
  1442.   
  1443.   # include "sendmail.h"
  1444. --- 33,39 ----
  1445.    */
  1446.   
  1447.   #ifndef lint
  1448. ! static char sccsid[] = "@(#)savemail.c    8.14 (Berkeley) 10/15/93";
  1449.   #endif /* not lint */
  1450.   
  1451.   # include "sendmail.h"
  1452. ***************
  1453. *** 598,604 ****
  1454.       **  Output introductory information.
  1455.       */
  1456.   
  1457. !     sprintf(buf, "The original message was received at %s", arpadate(NULL));
  1458.       putline(buf, fp, m);
  1459.       expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
  1460.       putline(buf, fp, m);
  1461. --- 598,620 ----
  1462.       **  Output introductory information.
  1463.       */
  1464.   
  1465. !     for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
  1466. !         if (bitset(QBADADDR, q->q_flags))
  1467. !             break;
  1468. !     if (q == NULL)
  1469. !     {
  1470. !         putline("    **********************************************",
  1471. !             fp, m);
  1472. !         putline("    **      THIS IS A WARNING MESSAGE ONLY      **",
  1473. !             fp, m);
  1474. !         putline("    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **",
  1475. !             fp, m);
  1476. !         putline("    **********************************************",
  1477. !             fp, m);
  1478. !         putline("", fp, m);
  1479. !     }
  1480. !     sprintf(buf, "The original message was received at %s",
  1481. !         arpadate(ctime(&e->e_parent->e_ctime)));
  1482.       putline(buf, fp, m);
  1483.       expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
  1484.       putline(buf, fp, m);
  1485. *** src/sendmail.h.OLD    Thu Oct 14 07:55:20 1993
  1486. --- src/sendmail.h    Fri Oct 15 08:35:14 1993
  1487. ***************
  1488. *** 31,37 ****
  1489.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1490.    * SUCH DAMAGE.
  1491.    *
  1492. !  *    @(#)sendmail.h    8.23 (Berkeley) 9/25/93
  1493.    */
  1494.   
  1495.   /*
  1496. --- 31,37 ----
  1497.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1498.    * SUCH DAMAGE.
  1499.    *
  1500. !  *    @(#)sendmail.h    8.24 (Berkeley) 10/15/93
  1501.    */
  1502.   
  1503.   /*
  1504. ***************
  1505. *** 41,47 ****
  1506.   # ifdef _DEFINE
  1507.   # define EXTERN
  1508.   # ifndef lint
  1509. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.23        9/25/93";
  1510.   # endif
  1511.   # else /*  _DEFINE */
  1512.   # define EXTERN extern
  1513. --- 41,47 ----
  1514.   # ifdef _DEFINE
  1515.   # define EXTERN
  1516.   # ifndef lint
  1517. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.24        10/15/93";
  1518.   # endif
  1519.   # else /*  _DEFINE */
  1520.   # define EXTERN extern
  1521. ***************
  1522. *** 803,808 ****
  1523. --- 803,809 ----
  1524.   EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
  1525.   EXTERN bool    TryNullMXList;    /* if we are the best MX, try host directly */
  1526.   EXTERN bool    CheckLoopBack;    /* check for loopback on HELO packet */
  1527. + EXTERN bool    InChild;    /* true if running in an SMTP subprocess */
  1528.   EXTERN char    SpaceSub;    /* substitution for <lwsp> */
  1529.   EXTERN int    PrivacyFlags;    /* privacy flags */
  1530.   EXTERN char    *ConfFile;    /* location of configuration file [conf.c] */
  1531. *** src/srvrsmtp.c.OLD    Tue Oct 12 06:41:24 1993
  1532. --- src/srvrsmtp.c    Fri Oct 15 08:35:15 1993
  1533. ***************
  1534. *** 36,44 ****
  1535.   
  1536.   #ifndef lint
  1537.   #ifdef SMTP
  1538. ! static char sccsid[] = "@(#)srvrsmtp.c    8.16 (Berkeley) 9/30/93 (with SMTP)";
  1539.   #else
  1540. ! static char sccsid[] = "@(#)srvrsmtp.c    8.16 (Berkeley) 9/30/93 (without SMTP)";
  1541.   #endif
  1542.   #endif /* not lint */
  1543.   
  1544. --- 36,44 ----
  1545.   
  1546.   #ifndef lint
  1547.   #ifdef SMTP
  1548. ! static char sccsid[] = "@(#)srvrsmtp.c    8.17 (Berkeley) 10/15/93 (with SMTP)";
  1549.   #else
  1550. ! static char sccsid[] = "@(#)srvrsmtp.c    8.17 (Berkeley) 10/15/93 (without SMTP)";
  1551.   #endif
  1552.   #endif /* not lint */
  1553.   
  1554. ***************
  1555. *** 113,123 ****
  1556.       NULL,        CMDERROR,
  1557.   };
  1558.   
  1559. - bool    InChild = FALSE;        /* true if running in a subprocess */
  1560.   bool    OneXact = FALSE;        /* one xaction only this run */
  1561.   
  1562. - #define EX_QUIT        22        /* special code for QUIT command */
  1563.   static char    *skipword();
  1564.   
  1565.   smtp(e)
  1566. --- 113,120 ----
  1567. ***************
  1568. *** 488,494 ****
  1569.               e->e_to = p;
  1570.               if (!bitset(QBADADDR, a->q_flags))
  1571.               {
  1572. !                 message("250 Recipient ok");
  1573.                   nrcpts++;
  1574.               }
  1575.               else
  1576. --- 485,493 ----
  1577.               e->e_to = p;
  1578.               if (!bitset(QBADADDR, a->q_flags))
  1579.               {
  1580. !                 message("250 Recipient ok%s",
  1581. !                     bitset(QQUEUEUP, a->q_flags) ?
  1582. !                         " (will queue)" : "");
  1583.                   nrcpts++;
  1584.               }
  1585.               else
  1586. ***************
  1587. *** 506,512 ****
  1588.                   message("503 Need MAIL command");
  1589.                   break;
  1590.               }
  1591. !             else if (e->e_nrcpts <= 0)
  1592.               {
  1593.                   message("503 Need RCPT (recipient)");
  1594.                   break;
  1595. --- 505,511 ----
  1596.                   message("503 Need MAIL command");
  1597.                   break;
  1598.               }
  1599. !             else if (nrcpts <= 0)
  1600.               {
  1601.                   message("503 Need RCPT (recipient)");
  1602.                   break;
  1603. *** src/usersmtp.c.OLD    Sat Oct  9 08:04:58 1993
  1604. --- src/usersmtp.c    Fri Oct 15 08:35:08 1993
  1605. ***************
  1606. *** 36,44 ****
  1607.   
  1608.   #ifndef lint
  1609.   #ifdef SMTP
  1610. ! static char sccsid[] = "@(#)usersmtp.c    8.10 (Berkeley) 9/25/93 (with SMTP)";
  1611.   #else
  1612. ! static char sccsid[] = "@(#)usersmtp.c    8.10 (Berkeley) 9/25/93 (without SMTP)";
  1613.   #endif
  1614.   #endif /* not lint */
  1615.   
  1616. --- 36,44 ----
  1617.   
  1618.   #ifndef lint
  1619.   #ifdef SMTP
  1620. ! static char sccsid[] = "@(#)usersmtp.c    8.11 (Berkeley) 10/15/93 (with SMTP)";
  1621.   #else
  1622. ! static char sccsid[] = "@(#)usersmtp.c    8.11 (Berkeley) 10/15/93 (without SMTP)";
  1623.   #endif
  1624.   #endif /* not lint */
  1625.   
  1626. ***************
  1627. *** 523,528 ****
  1628. --- 523,538 ----
  1629.       (*e->e_putbody)(mci->mci_out, m, e, NULL);
  1630.   
  1631.       clrevent(ev);
  1632. +     if (ferror(mci->mci_out))
  1633. +     {
  1634. +         /* error during processing -- don't send the dot */
  1635. +         mci->mci_errno = EIO;
  1636. +         mci->mci_exitstat = EX_IOERR;
  1637. +         mci->mci_state = MCIS_ERROR;
  1638. +         smtpquit(m, mci, e);
  1639. +         return EX_IOERR;
  1640. +     }
  1641.   
  1642.       /* terminate the message */
  1643.       fprintf(mci->mci_out, ".%s", m->m_eol);
  1644. *** src/version.c.OLD    Sat Oct  9 08:08:26 1993
  1645. --- src/version.c    Fri Oct 15 08:35:11 1993
  1646. ***************
  1647. *** 33,39 ****
  1648.    */
  1649.   
  1650.   #ifndef lint
  1651. ! static char sccsid[] = "@(#)version.c    8.6.1.1 (Berkeley) 10/8/93";
  1652.   #endif /* not lint */
  1653.   
  1654. ! char    Version[] = "8.6.1";
  1655. --- 33,39 ----
  1656.    */
  1657.   
  1658.   #ifndef lint
  1659. ! static char sccsid[] = "@(#)version.c    8.6.1.2 (Berkeley) 10/15/93";
  1660.   #endif /* not lint */
  1661.   
  1662. ! char    Version[] = "8.6.2";
  1663.