dovecot-1.1: deliver: Don't send rejects to any messages that ha...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 2 06:12:12 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/48c901009fba
changeset: 8347:48c901009fba
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 01 23:11:06 2009 -0400
description:
deliver: Don't send rejects to any messages that have Auto-Submitted header.

diffstat:

1 file changed, 9 insertions(+), 1 deletion(-)
src/deliver/mail-send.c |   10 +++++++++-

diffs (23 lines):

diff -r 01804b4971dd -r 48c901009fba src/deliver/mail-send.c
--- a/src/deliver/mail-send.c	Tue Aug 25 09:30:11 2009 -0400
+++ b/src/deliver/mail-send.c	Tue Sep 01 23:11:06 2009 -0400
@@ -56,10 +56,18 @@ int mail_send_rejection(struct mail *mai
     struct message_size hdr_size;
     const char *return_addr, *hdr;
     const unsigned char *data;
-    const char *msgid, *orig_msgid, *boundary;
+    const char *value, *msgid, *orig_msgid, *boundary;
     string_t *str;
     size_t size;
     int ret;
+
+    if (mail_get_first_header(mail, "Auto-Submitted", &value) > 0 &&
+	strcasecmp(value, "no") != 0) {
+	    i_info("msgid=%s: Auto-submitted message discarded: %s",
+		   orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80),
+		   str_sanitize(reason, 512));
+	    return 0;
+    }
 
     if (mail_get_first_header(mail, "Message-ID", &orig_msgid) < 0)
 	    orig_msgid = NULL;


More information about the dovecot-cvs mailing list