From e3c18f4c5b8fd70763d32d2e0bb67e20ea7a1160 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 5 Jun 1997 20:49:59 +0000 Subject: Yet another step towards handling zero-length messages. svn path=/trunk/; revision=1068 --- driver.c | 59 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 75e2094e..9aaec733 100644 --- a/driver.c +++ b/driver.c @@ -1119,37 +1119,6 @@ int delimited; /* does the protocol use a message delimiter? */ } } - /* - * End-of-message processing starts here - */ - - if (outlevel == O_VERBOSE) - fputc('\n', stderr); - - if (ctl->mda) - { - int rc; - - /* close the delivery pipe, we'll reopen before next message */ - rc = pclose(sinkfp); - signal(SIGCHLD, sigchld); - if (rc) - { - error(0, -1, "MDA exited abnormally or returned nonzero status"); - return(PS_IOERR); - } - } - else if (forward) - { - /* write message terminator */ - if (SMTP_eom(ctl->smtp_socket) != SM_OK) - { - error(0, -1, "SMTP listener refused delivery"); - ctl->errcount++; - return(PS_TRANSIENT); - } - } - return(PS_SUCCESS); } @@ -1593,6 +1562,34 @@ const struct method *proto; /* protocol method table */ } } + /* end-of-message processing starts here */ + if (outlevel == O_VERBOSE) + fputc('\n', stderr); + + if (ctl->mda) + { + int rc; + + /* close the delivery pipe, we'll reopen before next message */ + rc = pclose(sinkfp); + signal(SIGCHLD, sigchld); + if (rc) + { + error(0, -1, "MDA exited abnormally or returned nonzero status"); + goto cleanUp; + } + } + else if (!suppress_forward) + { + /* write message terminator */ + if (SMTP_eom(ctl->smtp_socket) != SM_OK) + { + error(0, -1, "SMTP listener refused delivery"); + ctl->errcount++; + suppress_delete = TRUE; + } + } + fetches++; } -- cgit v1.2.3