fixes to handle null messages -- why did this break?
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 16 Apr 1993 10:03:41 +0000 (02:03 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 16 Apr 1993 10:03:41 +0000 (02:03 -0800)
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 6.33
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.48

usr/src/usr.sbin/sendmail/src/queue.c
usr/src/usr.sbin/sendmail/src/savemail.c

index 241586f..7a86916 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    6.47 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    6.48 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    6.47 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    6.48 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -944,6 +944,14 @@ readqf(e)
                return FALSE;
        }
 
                return FALSE;
        }
 
+       if (st.st_size == 0)
+       {
+               /* must be a bogus file -- just remove it */
+               (void) unlink(qf);
+               fclose(qfp);
+               return FALSE;
+       }
+
        /* save this lock */
        e->e_lockfp = qfp;
 
        /* save this lock */
        e->e_lockfp = qfp;
 
index ec446ec..ae842c3 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)savemail.c 6.32 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 6.33 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <pwd.h>
 #endif /* not lint */
 
 # include <pwd.h>
@@ -59,10 +59,17 @@ savemail(e)
 
        if (tTd(6, 1))
        {
 
        if (tTd(6, 1))
        {
-               printf("\nsavemail, errormode = %c\n  e_from=", e->e_errormode);
+               printf("\nsavemail, errormode = %c, id = %s\n  e_from=",
+                       e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id);
                printaddr(&e->e_from, FALSE);
        }
 
                printaddr(&e->e_from, FALSE);
        }
 
+       if (e->e_id == NULL)
+       {
+               /* can't return a message with no id */
+               return;
+       }
+
        e->e_flags &= ~EF_FATALERRS;
 
        /*
        e->e_flags &= ~EF_FATALERRS;
 
        /*