dccifd hung when header section omited in message body

Vernon Schryver vjs@calcite.rhyolite.com
Wed Aug 17 01:51:53 UTC 2005


> From: =?ISO-8859-2?Q?Martin_P=E1la?= <Martin.Pala@oskar.cz>

> during dccifd testing i tried this simple test (connect to dccifd
> smtp proxy running on 10025):

> MAIL FROM: <martinp@tildeslash.com>
> 250 Ok
> RCPT TO: <martin.pala@mujoskar.cz>
> 250 Ok
> DATA
> 354 Enter mail to dccifd
> test
> .


Thanks for the test case.
I hope the enclosed patch will fix the problem.


Vernon Schryver    vjs@rhyolite.com




*** dccifd.c	Tue Aug  9 12:07:54 2005
--- new-dccifd.c	Tue Aug 16 19:08:55 2005
***************
*** 1230,1238 ****
  			} else if (eol+1 >= wp->msg_rd.in) {
  				/* insist on having the character after '\n'
  				 * or pretend we could not find it */
! 				if (i < wp->msg_rd.size)
  					break;
- 				--eol;
  				nl = 0;
  			} else {
  				nl = eol+1;
--- 1230,1238 ----
  			} else if (eol+1 >= wp->msg_rd.in) {
  				/* insist on having the character after '\n'
  				 * or pretend we could not find it */
! 				if (i < wp->msg_rd.size
! 					&& wp->msg_rd.out != wp->msg_rd.base)
  					break;
  				nl = 0;
  			} else {
  				nl = eol+1;
***************
*** 2810,2815 ****
--- 2810,2833 ----
  		buf_write(wp, &wp->reply_out, "\r\n", 2);
  
  		log_smtp_reply(&wp->cw);
+ 
+ 		/* Postfix wants a before-queue proxy to "abort the
+ 		 * connnection" (TCP shutdown?) after a rejection.
+ 		 * For testing with sendmail, send a RSET command. */
+ 		if (proxy_out_family != AF_UNSPEC) {
+ 			buf_write(wp, &wp->msg_wt,
+ 				  "RSET\r\n", STRZ("RSET\r\n"));
+ 			buf_write_flush(wp, &wp->msg_wt);
+ 			/* sendmail will respond */
+ 			if (msg_read_line(wp, &wp->reply_in)
+ 			    && dcc_clnt_debug >= SMTP_DEBUG_TRACE) {
+ 				smtp_trace(wp, "ignore response to RSET",
+ 					   wp->reply_in.out,
+ 					   wp->reply_in.next_line
+ 					   - wp->reply_in.out);
+ 				wp->reply_in.out = wp->reply_in.next_line;
+ 			}
+ 		}
  
  		result = wp->cw.reply.result;
  



More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.