bugThe nmh Mail Handling System - Bugs: bug #29716, mail lossage due to slocal failing...


bug #29716: mail lossage due to slocal failing to check close() status (with patch)

Submitted by:  None
Submitted on:  Thu 29 Apr 2010 04:38:58 PM UTC  
Category:  Bug Severity:  3 - Normal
Priority:  5 - Normal Status:  None
Assigned to:  None Open/Closed:  Closed

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 06 Feb 2012 02:43:18 PM UTC, comment #1: 

Patch was submitted by Scott Snyder and applied.

Ken Hornstein <kenh>
Project Administrator
Thu 29 Apr 2010 04:38:58 PM UTC, original submission:  

hello -

I feed mail from fetchmail to slocal to do mail filtering.
The default delivery is then to a mbox in my home directory,
which is NFS mounted.

Several times, i've noticed that if my disk quota fills up, i lose
incoming mail.  In such a situation, slocal still reports that the
message was delivered successfully to the maildrop, even though it
was not.

What happens here is that with this configuration, the write() call
returns a success status.  We don't get an error until we call close()
[which properly fails returning -1 with EDQUOT].  However, slocal
ignores the return stauts from close(), so it reports success --- leading
fetchmail to delete the original message.

This patch fixes the problem for me.  Now slocal properly reports
an error when it can't write to the maildrop.  (There are likely
other close() calls that should also be fixed, however.)

2010-04-29  scott snyder  <snyder@bnl.gov>

        * uip/dropsbr.c (mbx_close): Propagate return status code.
        * uip/slocal.c (usr_file): Check mbx_close return status.

--- nmh-1.3/uip/dropsbr.c-orig        2010-04-29 10:48:10.738405000 -0500
+++ nmh-1.3/uip/dropsbr.c        2010-04-29 10:49:29.341723000 -0500
@@ -469,8 +469,9 @@
mbx_close (char *mailbox, int md)
-    lkclose (md, mailbox);
-    return OK;
+    if (lkclose (md, mailbox) == 0)
+      return OK;
+    return NOTOK;

--- nmh-1.3/uip/slocal.c-orig        2010-04-29 10:51:22.107844000 -0500
+++ nmh-1.3/uip/slocal.c        2010-04-29 10:52:08.409497000 -0500
@@ -1067,7 +1067,11 @@

     /* close and unlock file */
-    mbx_close (mailbox, md);
+    if (mbx_close (mailbox, md) == NOTOK) {
+        if (verbose)
+            adorn ("", "error closing:");
+        return -1;
+    }

     if (verbose)
         verbose_printf (", success.\n");



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by kenh (Posted a comment)



    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-06 kenh Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.7