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

smtp.c needs another RSET



If smtp tries to send two message in one connection, and the end-of-data
returns a failure, the second MAIL could fail:

17825r	220 cgrnserc.UWaterloo.ca Sendmail AIX 3.2/UCB 5.64/4.03UW ready at Thu, 29 Apr 1993 02:50:03 -0400
17825w	HELO undergrad.math.uwaterloo.ca
17825r	250 cgrnserc.UWaterloo.ca Hello undergrad.math.uwaterloo.ca
17825#	246535-3: <93Apr28.054138edt.246535-3@undergrad.math.uwaterloo.ca>
17825w	MAIL From:<accounts@undergrad.math.uwaterloo.ca>
17825r	250 <accounts@undergrad.math.uwaterloo.ca>... Sender is valid.
17825w	RCPT To:<rucker@cgrnserc.uwaterloo.ca>
17825r	250 <rucker@cgrnserc.uwaterloo.ca>... Recipient is valid.
17825w	DATA
17825r	354 Enter mail. End with the . character on a line by itself.
17825w	.
17825r	452 Out of disk space for a temporary file: There is not enough space in the file system.
17825w	MAIL From:<@undergrad.math.uwaterloo.ca:msmorris@watsci.UWaterloo.ca>
17825r	503 The sender is already specified.
17825w	RSET
17825r	250 Resetting the state.
17825w	QUIT
17825r	221 cgrnserc.UWaterloo.ca: closing the connection.

The following patch adds another RSET, which would probably make the above
example work:

*** 1.1	1992/11/03 18:22:16
--- 1.2	1993/04/29 18:40:31
***************
*** 403,409 ****
  	 * Murphy's Law you know: Connections will hang even when they can't.
  	 */
  	tout = timeout, timeout = 60*60*24;
! 	r = smtpwrite(smtpfp, ".", (char *) NULL);
  	timeout = tout;
  	if (logfp != NULL) {
  		if (r != EX_OK)
--- 403,411 ----
  	 * Murphy's Law you know: Connections will hang even when they can't.
  	 */
  	tout = timeout, timeout = 60*60*24;
! 	if ((r = smtpwrite(smtpfp, ".", (char *) NULL)) != EX_OK) {
! 		(void) smtpwrite(smtpfp, "RSET", (char *)NULL);
! 	}
  	timeout = tout;
  	if (logfp != NULL) {
  		if (r != EX_OK)