]> git.ipfire.org Git - people/ms/dma.git/commitdiff
dma: allow empty sender in queue files
authorSimon Schubert <corecode@dragonflybsd.org>
Sun, 20 Sep 2009 18:57:34 +0000 (20:57 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Sun, 20 Sep 2009 19:01:27 +0000 (21:01 +0200)
Empty senders happen when a bounce gets queued, so we need to accept
such queue files.

spool.c

diff --git a/spool.c b/spool.c
index 23f6e420e0231aee09250fc7c39ef89288c6fdfe..0c5d50beb9e2ab6c18a9ee8ae732b7a6a4220be6 100644 (file)
--- a/spool.c
+++ b/spool.c
@@ -176,7 +176,7 @@ readqueuef(struct queue *queue, char *queuefn)
                        s++;
 
                s = strdup(s);
-               if (s == NULL || s[0] == 0)
+               if (s == NULL)
                        goto malformed;
 
                if (strcmp(line, "ID") == 0) {
@@ -192,7 +192,8 @@ readqueuef(struct queue *queue, char *queuefn)
                }
        }
 
-       if (queueid == NULL || sender == NULL || addr == NULL) {
+       if (queueid == NULL || sender == NULL || addr == NULL ||
+           *queueid == 0 || *addr == 0) {
 malformed:
                errno = EINVAL;
                syslog(LOG_ERR, "malformed queue file `%s'", queuefn);