]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: Crashfix when sending rejection mail with Auto-Submitted: header.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:35:31 +0000 (01:35 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:35:31 +0000 (01:35 +0300)
--HG--
branch : HEAD

src/lib-lda/mail-send.c

index 2002f280ed8e721f3fce1ba3f2d23825b8ca6fe2..324a263fcb68350e5ed8bd1677190787414990e7 100644 (file)
@@ -64,6 +64,9 @@ int mail_send_rejection(struct mail_deliver_context *ctx, const char *recipient,
     size_t size;
     int ret;
 
+    if (mail_get_first_header(mail, "Message-ID", &orig_msgid) < 0)
+           orig_msgid = NULL;
+
     if (mail_get_first_header(mail, "Auto-Submitted", &value) > 0 &&
        strcasecmp(value, "no") != 0) {
            i_info("msgid=%s: Auto-submitted message discarded: %s",
@@ -72,8 +75,6 @@ int mail_send_rejection(struct mail_deliver_context *ctx, const char *recipient,
            return 0;
     }
 
-    if (mail_get_first_header(mail, "Message-ID", &orig_msgid) < 0)
-           orig_msgid = NULL;
     return_addr = mail_deliver_get_return_address(ctx);
     if (return_addr == NULL) {
            i_info("msgid=%s: Return-Path missing, rejection reason: %s",