aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-06-05 20:49:59 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-06-05 20:49:59 +0000
commite3c18f4c5b8fd70763d32d2e0bb67e20ea7a1160 (patch)
treeab3eba78d7cc589d59e951da9fc48a2629d4051e
parent3e5b4dd8260187175b66e1943f686939b5d2c628 (diff)
downloadfetchmail-e3c18f4c5b8fd70763d32d2e0bb67e20ea7a1160.tar.gz
fetchmail-e3c18f4c5b8fd70763d32d2e0bb67e20ea7a1160.tar.bz2
fetchmail-e3c18f4c5b8fd70763d32d2e0bb67e20ea7a1160.zip
Yet another step towards handling zero-length messages.
svn path=/trunk/; revision=1068
-rw-r--r--driver.c59
1 files changed, 28 insertions, 31 deletions
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++;
}