[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suspect error in SMTP ta handling of empty from envelope address



I believe that this is an appropriate fix for the problem:  This patch is
against a locally modified smtp.c, so the line numbers are unlikely to match
yours on the second hunk, but there should be enough context should you wish to
patch your smtp similarly.   If anyone has any comments on this i'd be happy to
hear them.

					\nick

*** smtp.c.bak	Thu Jul 13 22:38:29 1995
--- smtp.c	Thu Jul 13 22:46:42 1995
***************
*** 61,66 ****
--- 61,67 ----

  #define	PROGNAME	"smtpclient"	/* for logging */
  #define	CHANNEL		"smtp"	/* the default channel name we deliver
for */
+ #define	ERRORCHANNEL	"error" /* messages originating here are MAIL
FROM: <> */

  /* SV_INTERRUPT is defined in <sys/signal.h> on SunOS */
  #ifdef	SV_INTERRUPT
***************
*** 332,338 ****

  	if (lseek(messagefd, msgoffset, L_SET) < 0L)
  		warning("Cannot seek to message body! (%m)", (char *)NULL);
! 	r = smtpwrite(smtpfp, "MAIL From:<%s>", startrp->addr->link->user);
  	if (r != EX_OK) {
  		for (rp = startrp; rp != endrp; rp = rp->next)
  			diagnostic(rp, r, "%s", remotemsg);
--- 333,344 ----

  	if (lseek(messagefd, msgoffset, L_SET) < 0L)
  		warning("Cannot seek to message body! (%m)", (char *)NULL);
! 	/* if we are relaying an error message, we don't want to get mail back
*/
! 	if (cistrcmp(startrp->addr->link->channel, ERRORCHANNEL) == 0) {
! 	  r = smtpwrite(smtpfp, "MAIL From:<>", (char *)NULL);
! 	} else {
! 	  r = smtpwrite(smtpfp, "MAIL From:<%s>", startrp->addr->link->user);
! 	}
  	if (r != EX_OK) {
  		for (rp = startrp; rp != endrp; rp = rp->next)
  			diagnostic(rp, r, "%s", remotemsg);