home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / mail / sendmail / 2213 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  5.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!sgiblab!a2i!dhesi
  2. From: dhesi@rahul.net (Rahul Dhesi)
  3. Newsgroups: comp.mail.sendmail
  4. Subject: Re: Removing msg body in IDA for postmaster
  5. Message-ID: <Bu6su3.G7F@rahul.net>
  6. Date: 7 Sep 92 02:42:02 GMT
  7. References: <root.715272995@merlin> <1856@nikhefh.nikhef.nl>
  8. Sender: news@rahul.net (Usenet News)
  9. Organization: a2i network
  10. Lines: 163
  11. Nntp-Posting-Host: bolero
  12.  
  13. Here are very unofficial diffs for IDA sendmail so it will accept the
  14. OP option as follows:
  15.  
  16.    OP      -- send headers of bounced mail to postmaster
  17.    OPname  -- send headers of bounced mail to specified name
  18.    OP+     -- send complete bounced message to postmaster
  19.    OP+name -- send complete bounced message to specified name
  20.  
  21. I took Eric Wassenaar's changes and added a few more of my own.  These
  22. changes are for sendmail 5.65c with IDA changes revision 1.4.4.4
  23. (according to the ChangeLog file).  There diffs have been briefly
  24. tested and only under SunOS 4.1 with gcc 2.2.2, so they should be
  25. handled with great care.  Changes given here are to the following files
  26. in the src directory:
  27.  
  28.    readcf.c, savemail.c, sendmail.h
  29.  
  30. These are unified diffs, so be sure to use a recent version of
  31. "patch".  If "patch" fails, please apply the changes by hand.
  32.  
  33. Those of you who frequently modify the sendmail sources are invited to
  34. look for any bugs and post fixes.
  35.  
  36. Rahul Dhesi <dhesi@rahul.net>
  37. also:  dhesi@cirrus.com
  38.  
  39. ===================================================================
  40. RCS file: RCS/readcf.c,v
  41. retrieving revision 5.21.0.15
  42. diff -u5 -r5.21.0.15 readcf.c
  43. --- 5.21.0.15    1991/08/06 18:17:12
  44. +++ readcf.c    1992/09/06 19:51:16
  45. @@ -18,11 +18,11 @@
  46.   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  47.   */
  48.  
  49.  #ifndef lint
  50.  static char sccsid[] = "@(#)readcf.c    5.21 (Berkeley) 6/1/90";
  51. -static char  rcsid[] = "@(#)$Id: readcf.c,v 5.21.0.15 1991/08/06 18:17:12 paul Exp $";
  52. +static char  rcsid[] = "@(#)$Id: readcf.c,v 5.21.0.16 1992/09/06 19:50:43 dhesi Exp $";
  53.  #endif /* not lint */
  54.  
  55.  #include "sendmail.h"
  56.  
  57.  #ifdef __STDC__
  58. @@ -1044,10 +1044,17 @@
  59.              CurEnv->e_flags &= ~EF_OLDSTYLE;
  60.          break;
  61.  
  62.        case 'P':        /* postmaster copy address for returned mail */
  63.          PostMasterCopy = newstr(val);
  64. +        if (*PostMasterCopy == '+') {
  65. +            PostMasterCopy++;
  66. +            PostMasterCopyFull = 1;
  67. +        }
  68. +        if (*PostMasterCopy == '\0') {
  69. +            PostMasterCopy = "postmaster"; /* minor memory leak */
  70. +        }
  71.          break;
  72.  
  73.        case 'q':        /* slope of queue only function */
  74.          QueueFactor = atoi(val);
  75.          break;
  76. ===================================================================
  77. RCS file: RCS/savemail.c,v
  78. retrieving revision 5.13.0.15
  79. diff -u5 -r5.13.0.15 savemail.c
  80. --- 5.13.0.15    1991/06/24 16:22:54
  81. +++ savemail.c    1992/09/06 19:52:03
  82. @@ -18,11 +18,11 @@
  83.   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  84.   */
  85.  
  86.  #ifndef lint
  87.  static char sccsid[] = "@(#)savemail.c    5.14 (Berkeley) 8/29/90";
  88. -static char  rcsid[] = "@(#)$Id: savemail.c,v 5.13.0.15 1991/06/24 16:22:54 paul Exp $";
  89. +static char  rcsid[] = "@(#)$Id: savemail.c,v 5.13.0.17 1992/09/06 19:51:32 dhesi Exp $";
  90.  #endif /* not lint */
  91.  
  92.  #include "sendmail.h"
  93.  #include <pwd.h>
  94.  
  95. @@ -226,11 +226,11 @@
  96.                      sendtolist(e->e_from.q_paddr,
  97.                          (ADDRESS *) NULL,
  98.                          &e->e_errorqueue);
  99.  
  100.                  /* deliver a cc: to the postmaster if desired */
  101. -                if (PostMasterCopy != NULL)
  102. +                if (PostMasterCopyFull)
  103.                      sendtolist(PostMasterCopy,
  104.                          (ADDRESS *) NULL,
  105.                          &e->e_errorqueue);
  106.                  q = e->e_errorqueue;
  107.              }
  108. @@ -341,10 +341,22 @@
  109.  
  110.              /* leave the locked queue & transcript files around */
  111.              exit(EX_SOFTWARE);
  112.          }
  113.      }
  114. +
  115. +    if (PostMasterCopy) {
  116. +        /*
  117. +        From: e07@nikhefh.nikhef.nl (Eric Wassenaar)
  118. +        Newsgroups: comp.mail.sendmail
  119. +        Message-Id: <1856@nikhefh.nikhef.nl>
  120. +        Date: 4 Sep 92 20:18:59 GMT
  121. +        */
  122. +        q = (ADDRESS *) NULL;
  123. +        sendtolist(PostMasterCopy, (ADDRESS *) NULL, &q);
  124. +        (void) returntosender("Delivery failure", q, FALSE);
  125. +    }
  126.  }
  127.   /*
  128.  **  RETURNTOSENDER -- return a message to the sender with an error.
  129.  **
  130.  **    Parameters:
  131. @@ -417,11 +429,12 @@
  132.      to = buf;
  133.      for (q = returnq; q != NULL; q = q->q_next)
  134.      {
  135.          if (q->q_alias != NULL)
  136.              continue;
  137. -        if (PostMasterCopy && (strcmp(q->q_paddr, PostMasterCopy) == 0))
  138. +        if (PostMasterCopyFull && 
  139. +            (strcmp(q->q_paddr, PostMasterCopy) == 0))
  140.              cc = q->q_paddr;
  141.          else
  142.          {
  143.              /* Not Postmaster; already on the To: line? */
  144.              for (p = returnq; p != q; p = p->q_next)
  145. ===================================================================
  146. RCS file: RCS/sendmail.h,v
  147. retrieving revision 5.16.0.24
  148. diff -u5 -r5.16.0.24 sendmail.h
  149. --- 5.16.0.24    1991/08/14 18:28:19
  150. +++ sendmail.h    1992/09/06 19:52:24
  151. @@ -26,11 +26,11 @@
  152.  
  153.  # ifdef _DEFINE
  154.  #  define EXTERN
  155.  #  ifndef lint
  156.  static char SmailSccsId[] =    "@(#)sendmail.h    5.16        6/1/90";
  157. -static char SmailRcsId[] =    "@(#)$Id: sendmail.h,v 5.16.0.24 1991/08/14 18:28:19 paul Exp $";
  158. +static char SmailRcsId[] =    "@(#)$Id: sendmail.h,v 5.16.0.25 1992/09/06 19:52:11 dhesi Exp $";
  159.  #  endif /* lint */
  160.  # else  /* !_DEFINE */
  161.  #  define EXTERN extern
  162.  # endif /* _DEFINE */
  163.  
  164. @@ -730,10 +730,11 @@
  165.  EXTERN int    WkRecipFact;    /* multiplier for # of recipients -> priority */
  166.  EXTERN int    WkTimeFact;    /* priority offset each time this job is run */
  167.  EXTERN int    CheckPointLimit;    /* deliveries before checkpointing */
  168.  EXTERN int    Nmx;            /* number of MX RRs */
  169.  EXTERN char    *PostMasterCopy;    /* address to get errs cc's */
  170. +EXTERN int    PostMasterCopyFull;    /* .. whether to send full message */
  171.  EXTERN bool    SplitRewriting;    /* use split envelope/header rewriting */
  172.  EXTERN char    *MxHosts[MAXMXHOSTS+1];    /* for MX RRs */
  173.  EXTERN char    *TrustedUsers[MAXTRUST+1];    /* list of trusted users */
  174.   /*
  175.  **  Trace information
  176.