home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / mail / mh / 1426 < prev    next >
Encoding:
Text File  |  1992-12-21  |  6.4 KB  |  219 lines

  1. Xref: sparky comp.mail.mh:1426 comp.mail.sendmail:3045
  2. Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!vixie
  3. From: vixie@pa.dec.com (Paul A Vixie)
  4. Newsgroups: comp.mail.mh,comp.mail.sendmail
  5. Subject: Re: MH 6.8 sendmail/smtp uses "ONEX" (w. fix for IDA sendmail)
  6. Date: 19 Dec 92 15:29:11
  7. Organization: DEC Network Software Lab
  8. Lines: 204
  9. Distribution: world
  10. Message-ID: <VIXIE.92Dec19152911@cognition.pa.dec.com>
  11. References: <19322.724536025@dbc.mtview.ca.us> <BzFu4v.MxL@news.cso.uiuc.edu>
  12. NNTP-Posting-Host: cognition.pa.dec.com
  13. In-reply-to: paul@uxc.cso.uiuc.edu's message of Fri, 18 Dec 1992 04:36:30 GMT
  14.  
  15. In the October 1 release of King James Sendmail, we find in README.decwrl...
  16.  
  17. >option O (OO in .cf or -oO on command line) sets SynchRcv which is also set
  18. >by SMTP's ONEX command; if set, we will not fork on MAIL FROM commands.  we
  19. >(lovstrand and vixie) believe that we can recover the previous state without
  20. >having to isolate ourselves to a subprocess. this has performance implications
  21. >and also helps avoid the shared-input bug for brain-dead PC mailers that do
  22. >not wait for result codes and instead fill up the TCP pipe with their entire
  23. >conversation before reading back any result codes.
  24.  
  25. ...and if you turn this on, sendmail never forks -- i.e., it does what ONEX
  26. causes now, and has the side-effect that ONEX followed by multiple MAIL's is
  27. not an error.  lennart and i chose "O" as the option to remind us of "ONEX";
  28. this actually shipped with NeXT-Step 3.0 as far as I know.
  29.  
  30. Note that this has the effect of creating all the [qdtx]f[A-Z][A-Z]\d\d\d\d\d
  31. files in the mail queue directory with the same \d\d\d\d\d (PID) field, which
  32. is not a huge problem until you start using BSMTP or otherwise sending a lot
  33. of transactions in the same session.  Finding out that you need to be creating
  34. qfAL12345 requires 11 IO-intensive system calls.  This is not the average case
  35. for us, so this is still a big performance win.  However, it's clear that more
  36. thought (a lot more!) is needed.
  37.  
  38. Diffs follow.  Before you yell about the apparently-permanent effects of ONEX
  39. on the global variable SynchRcv, think about which forks have _already_
  40. happened by the time this code gets run.  Note, also, that these diffs are
  41. very similar to Paul Pomes', and there's a reason for that :-)..
  42.  
  43. *** 1.8    1992/05/04 18:03:24
  44. --- 1.9    1992/10/01 18:06:53
  45. ***************
  46. *** 20,26 ****
  47.   
  48.   #ifndef lint
  49.   static char sccsid[] = "@(#)readcf.c    5.21 (Berkeley) 6/1/90";
  50. ! static char rcsid[] = "$Id: readcf.c,v 1.8 1992/05/04 18:03:24 vixie Exp $";
  51.   #endif /* not lint */
  52.   
  53.   # include "sendmail.h"
  54. --- 20,26 ----
  55.   
  56.   #ifndef lint
  57.   static char sccsid[] = "@(#)readcf.c    5.21 (Berkeley) 6/1/90";
  58. ! static char rcsid[] = "$Id: readcf.c,v 1.9 1992/10/01 18:06:53 vixie Exp $";
  59.   #endif /* not lint */
  60.   
  61.   # include "sendmail.h"
  62. ***************
  63. *** 701,706 ****
  64. --- 701,707 ----
  65.       extern time_t convtime();
  66.       extern int QueueLA;
  67.       extern int RefuseLA;
  68. +     extern bool SynchRcv;
  69.       extern bool trusteduser();
  70.       extern char *username();
  71.   
  72. ***************
  73. *** 901,906 ****
  74. --- 902,911 ----
  75.               CurEnv->e_flags |= EF_OLDSTYLE;
  76.           else
  77.               CurEnv->e_flags &= ~EF_OLDSTYLE;
  78. +         break;
  79. +       case 'O':        /* Do synchronous receive in srvrsmtp */
  80. +         SynchRcv = atobool(val);
  81.           break;
  82.   
  83.         case 'P':        /* postmaster copy address for returned mail */
  84. *** 1.8    1992/05/04 18:05:40
  85. --- srvrsmtp.c    1992/10/01 18:07:49
  86. ***************
  87. *** 25,36 ****
  88.   static char sccsid[] =
  89.     "@(#)srvrsmtp.c    5.28 (Berkeley) 6/1/90 (with SMTP)";
  90.   static char rcsid[] =
  91. !   "$Id: srvrsmtp.c,v 1.8 1992/05/04 18:05:40 vixie Exp $ (with SMTP)";
  92.   #else
  93.   static char sccsid[] =
  94.     "@(#)srvrsmtp.c    5.28 (Berkeley) 6/1/90 (without SMTP)";
  95.   static char rcsid[] =
  96. !   "$Id: srvrsmtp.c,v 1.8 1992/05/04 18:05:40 vixie Exp $ (without SMTP)";
  97.   #endif
  98.   #endif /* not lint */
  99.   
  100. --- 25,36 ----
  101.   static char sccsid[] =
  102.     "@(#)srvrsmtp.c    5.28 (Berkeley) 6/1/90 (with SMTP)";
  103.   static char rcsid[] =
  104. !   "$Id: srvrsmtp.c,v 1.9 1992/10/01 18:07:49 vixie Exp $ (with SMTP)";
  105.   #else
  106.   static char sccsid[] =
  107.     "@(#)srvrsmtp.c    5.28 (Berkeley) 6/1/90 (without SMTP)";
  108.   static char rcsid[] =
  109. !   "$Id: srvrsmtp.c,v 1.9 1992/10/01 18:07:49 vixie Exp $ (without SMTP)";
  110.   #endif
  111.   #endif /* not lint */
  112.   
  113. ***************
  114. *** 100,106 ****
  115.   };
  116.   
  117.   bool    InChild = FALSE;        /* true if running in a subprocess */
  118. ! bool    OneXact = FALSE;        /* one xaction only this run */
  119.   
  120.   #define EX_QUIT        22        /* special code for QUIT command */
  121.   
  122. --- 100,106 ----
  123.   };
  124.   
  125.   bool    InChild = FALSE;        /* true if running in a subprocess */
  126. ! bool    SynchRcv = FALSE;        /* one xaction only this run */
  127.   
  128.   #define EX_QUIT        22        /* special code for QUIT command */
  129.   
  130. ***************
  131. *** 398,403 ****
  132. --- 398,411 ----
  133.               else
  134.                   CurEnv->e_flags &= ~EF_FATALERRS;
  135.   
  136. +             /*FALLTHROUGH*/
  137. +           case CMDRSET:
  138. +             if (c->cmdcode == CMDRSET) {
  139. +                 /* not a fallthrough from DATA */
  140. +                 message("250", "Reset state");
  141. +             }
  142.               /* if in a child, pop back to our parent */
  143.               if (InChild) {
  144.   #ifdef DECWRL
  145. ***************
  146. *** 407,413 ****
  147.               }
  148.   
  149.               /* clean up a bit */
  150. !             hasmail = 0;
  151.               dropenvelope(CurEnv);
  152.               CurEnv = newenvelope(CurEnv);
  153.               CurEnv->e_flags = BlankEnvelope.e_flags;
  154. --- 415,421 ----
  155.               }
  156.   
  157.               /* clean up a bit */
  158. !             hasmail = FALSE;
  159.               dropenvelope(CurEnv);
  160.               CurEnv = newenvelope(CurEnv);
  161.               CurEnv->e_flags = BlankEnvelope.e_flags;
  162. ***************
  163. *** 416,427 ****
  164.   #endif
  165.               break;
  166.   
  167. -           case CMDRSET:        /* rset -- reset state */
  168. -             message("250", "Reset state");
  169. -             if (InChild)
  170. -                 finis();
  171. -             break;
  172.             case CMDVRFY:        /* vrfy -- verify address */
  173.   #ifndef DECWRL
  174.               if (!batched && !runinchild("SMTP-VRFY") > 0)
  175. --- 424,429 ----
  176. ***************
  177. *** 491,497 ****
  178.               break;
  179.   
  180.             case CMDONEX:        /* doing one transaction only */
  181. !             OneXact = TRUE;
  182.               message("200", "Only one transaction");
  183.               break;
  184.   
  185. --- 493,499 ----
  186.               break;
  187.   
  188.             case CMDONEX:        /* doing one transaction only */
  189. !             SynchRcv = TRUE;
  190.               message("200", "Only one transaction");
  191.               break;
  192.   
  193. ***************
  194. *** 656,662 ****
  195.   {
  196.       int childpid;
  197.   
  198. !     if (!OneXact)
  199.       {
  200.           childpid = dofork();
  201.           if (childpid < 0)
  202. --- 658,664 ----
  203.   {
  204.       int childpid;
  205.   
  206. !     if (!SynchRcv)
  207.       {
  208.           childpid = dofork();
  209.           if (childpid < 0)
  210. --
  211. Paul Vixie, DEC Network Systems Lab    
  212. Palo Alto, California, USA             "Don't be a rebel, or a conformist;
  213. <vixie@pa.dec.com> decwrl!vixie        they're the same thing, anyway.  Find
  214. <paul@vix.com>     vixie!paul        your own path, and stay on it."  -me
  215.