Newsgroups: comp.mail.sendmail
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!world!spike
From: spike@coke.std.com (Joe Ilacqua)
Subject: Re: sendmail 5.65+IDA, e-mail privacy.
In-Reply-To: sjg@melb.bull.oz.au's message of 21 Jun 91 06: 08:35 GMT
Message-ID: <SPIKE.91Jun29160146@coke.std.com>
Sender: usenet@world.std.com (NNTP News Poster)
Nntp-Posting-Host: coke.std.com
Organization: Software Tool & Die
References: <1991Jun21.060835.904@melb.bull.oz.au>
Date: Sat, 29 Jun 1991 21:01:46 GMT
Lines: 99


sjg@melb.bull.oz.au (Simon J. Gerraty) writes:

[He would like the BSD sendmail do behave like Sun's and not include
the body in the Postmaster copy of an error message]


	He's a patch between stock 5.61 and the version we run here.
You'll probably have to apply it by hand.

	returntosender() has a flag to control whether the body is
returned with the error.  This change has returntosender() called
twice, once for the sender and once for the Postmaster instead of one
call for both.  All we have to do is turn off the include body flag
when we send the error to the Postmaster.

->Spike

*** ../sendmail/src/savemail.c	Sun Jan  1 20:18:17 1989
--- savemail.c	Sat Jun 23 14:00:54 1990
***************
*** 216,247 ****
  					sendtolist(e->e_from.q_paddr,
  						(ADDRESS *) NULL,
  						&e->e_errorqueue);
- 
- 				/* deliver a cc: to the postmaster if desired */
- 				if (PostMasterCopy != NULL)
- 					sendtolist(PostMasterCopy,
- 						(ADDRESS *) NULL,
- 						&e->e_errorqueue);
  				q = e->e_errorqueue;
  			}
! 			else
! 			{
! 				if (parseaddr("postmaster", q, 0, '\0') == NULL)
  				{
! 					syserr("cannot parse postmaster!");
! 					ExitStat = EX_SOFTWARE;
! 					state = ESM_USRTMP;
! 					break;
  				}
! 			}
! 			if (returntosender(e->e_message != NULL ? e->e_message :
! 					   "Unable to deliver mail",
! 					   q, TRUE) == 0)
! 			{
  				state = ESM_DONE;
  				break;
! 			}
! 
  			state = state == ESM_MAIL ? ESM_POSTMASTER : ESM_USRTMP;
  			break;
  
--- 216,260 ----
  					sendtolist(e->e_from.q_paddr,
  						(ADDRESS *) NULL,
  						&e->e_errorqueue);
  				q = e->e_errorqueue;
+ 				if (returntosender(e->e_message != NULL ? e->e_message :
+ 						   "Unable to deliver mail",
+ 						   q, TRUE) == 0)
+ 				    if (PostMasterCopy == NULL) {
+ 				      state = ESM_DONE;
+ 				      break;
+ 				    }
+ 				
+ 				e->e_errorqueue = NULL; 
  			}
! 			if ((state == ESM_POSTMASTER) || 
! 			    ((PostMasterCopy != NULL) && (state == ESM_MAIL)))
! 			  {
! 			    if (state == ESM_POSTMASTER) {
! 			      if (parseaddr("postmaster", q, 0, '\0') == NULL)
  				{
! 				  syserr("cannot parse postmaster!");
! 				  ExitStat = EX_SOFTWARE;
! 				  state = ESM_USRTMP;
! 				  break;
  				}
! 			    }
! 			    else {
! 			      /* deliver a cc: to the postmaster if desired */
! 			      sendtolist(PostMasterCopy,
! 					 (ADDRESS *) NULL,
! 					 &e->e_errorqueue);
! 			      q = e->e_errorqueue;
! 			    }
! 			    
! 			    if (returntosender(e->e_message != NULL ? e->e_message :
! 					       "Unable to deliver mail",
! 					       q, FALSE) == 0)
! 			      {
  				state = ESM_DONE;
  				break;
! 			      }
! 			  }
  			state = state == ESM_MAIL ? ESM_POSTMASTER : ESM_USRTMP;
  			break;
