dma: fix mail bouncing
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 20 Jul 2009 21:27:37 +0000 (23:27 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 21 Jul 2009 22:13:16 +0000 (00:13 +0200)
libexec/dma/dma.c

index deb629b..25e0c0c 100644 (file)
@@ -332,6 +332,9 @@ bounce(struct qitem *it, const char *reason)
        }
 
        LIST_INIT(&bounceq.queue);
+       if (add_recp(&bounceq, it->sender, "", 1) != 0)
+               goto fail;
+
        if (newspoolf(&bounceq, "") != 0)
                goto fail;
 
@@ -374,9 +377,6 @@ bounce(struct qitem *it, const char *reason)
        if (error < 0)
                goto fail;
 
-       if (add_recp(&bounceq, it->sender, "", 1) != 0)
-               goto fail;
-
        if (fseek(it->mailf, it->hdrlen, SEEK_SET) != 0)
                goto fail;
        if (config->features & FULLBOUNCE) {
@@ -395,7 +395,7 @@ bounce(struct qitem *it, const char *reason)
                }
        }
 
-       if (linkspool(&bounceq, "MAILER-DAEMON") != 0)
+       if (linkspool(&bounceq, "") != 0)
                goto fail;
        /* bounce is safe */