diff -u netqmail-1.05-orig/qmail-smtpd.c netqmail-1.05/qmail-smtpd.c --- netqmail-1.05-orig/qmail-smtpd.c Thu Jun 17 13:49:08 2004 +++ netqmail-1.05/qmail-smtpd.c Sat Jun 19 03:56:35 2004 @@ -299,7 +299,6 @@ flush(); r = timeoutread(timeout,fd,buf,len); if (r == -1) if (errno == error_timeout) die_alarm(); - if (r <= 0) die_read(); return r; } @@ -588,8 +587,18 @@ if (chdir(auto_qmail) == -1) die_control(); setup(); if (ipme_init() != 1) die_ipme(); - smtp_greet("220 "); - out(" ESMTP\r\n"); + if (env_get("SMTP_IN_PROGRESS")) + { + char pre_inbuf[1024]; + substdio pre_in = SUBSTDIO_FDBUF(saferead, 3, pre_inbuf, sizeof pre_inbuf); + + commands(&pre_in,&smtpcommands); + } + else + { + smtp_greet("220 "); + out(" ESMTP\r\n"); + } if (commands(&ssin,&smtpcommands) == 0) die_read(); die_nomem(); }