aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS28
-rw-r--r--fetchmail.c24
2 files changed, 34 insertions, 18 deletions
diff --git a/NEWS b/NEWS
index 9d472f3d..595b4ce2 100644
--- a/NEWS
+++ b/NEWS
@@ -18,25 +18,33 @@ Inflict severe pain on the person(s) responsible for removing LAST from POP3.
fetchmail-1.6 ():
+features --
+
+* You can now have multiple entries for the same server but different
+ users, and the right thing will happen (each user's mailbox will
+ be queried). Even better, you can now specify multiple users in a
+ single server entry.
+
+* Restore --mda, seems some people either can't run a port 25 listener
+ due to bizarre dynamic-SLIP problems, or won't for security reasons.
+
+* When delivering to an MDA, print error and die (before deleting the message!)
+ if the MDA returns nonzero status. Better safe than sorry.
+
+bug fixes --
+
* Makefile fixes for correct linking on Sparcs and avoiding duplication of
the md5 files (leading to harmless install-time error messages).
* Fix a bonehead coding error in pop3_delete() that was masked by the
Intel register architecture. *blush* Thanks to Jay Anderson.
-* Restore --mda, seems some people either can't run a port 25 listener
- due to bizarre dynamic-SLIP problems, or won't for security reasons.
-
* Fix bug that prevented SMTP from being specified on the defaults line.
-* Allow program to run with no .fetchmailrc file again.
-
-* Allow program to generate correct lockfiles under zsh.
+* Allow program to generate correct lockfiles when USER is undefined
+ (i.e. under zsh).
-* You can now have multiple entries for the same server but different
- users, and the right thing will happen (each user's mailbox will
- be queried). Even better, you can now specify multiple users in a
- single server entry.
+* Allow program to run with no .fetchmailrc file again.
fetchmail-1.5 (Thu Oct 3 04:35:15 EDT 1996):
diff --git a/fetchmail.c b/fetchmail.c
index 1fff5cca..19b08b01 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -566,20 +566,28 @@ struct hostrec *queryctl;
int closemailpipe (fd)
int fd;
{
- int err;
+ int err, status;
int childpid;
if (outlevel == O_VERBOSE)
fprintf(stderr, "about to close pipe %d\n", fd);
- err = close(fd);
-#if defined(STDC_HEADERS)
- childpid = wait(NULL);
-#else
- childpid = wait((int *) 0);
+ if ((err = close(fd)) != 0)
+ perror("fetchmail: closemailpipe: close failed");
+
+ childpid = wait(&status);
+
+#if defined(WIFEXITED) && defined(WEXITSTATUS)
+ /*
+ * Try to pass up an error if the MDA returned nonzero status,
+ * on the assumption that this means it was reporting failure.
+ */
+ if (WIFEXITED(status) == 0 || WEXITSTATUS(status) != 0)
+ {
+ perror("fetchmail: MDA exited abnormally or returned nonzero status");
+ err = -1;
+ }
#endif
- if (err)
- perror("fetchmail: closemailpipe: close");
if (outlevel == O_VERBOSE)
fprintf(stderr, "closed pipe %d\n", fd);