dovecot-2.2: lib-lda: mail_send_rejection() logs permanent rejec...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 25 13:15:53 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/dc5ba8637aa7
changeset: 17267:dc5ba8637aa7
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 25 15:57:03 2014 +0300
description:
lib-lda: mail_send_rejection() logs permanent rejections now with info level.
There's no need to log an error when return-path is invalid.

diffstat:

 src/lib-lda/mail-send.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 0f9ce0073c8d -r dc5ba8637aa7 src/lib-lda/mail-send.c
--- a/src/lib-lda/mail-send.c	Fri Apr 25 15:54:49 2014 +0300
+++ b/src/lib-lda/mail-send.c	Fri Apr 25 15:57:03 2014 +0300
@@ -58,7 +58,7 @@
     struct smtp_client *smtp_client;
     struct ostream *output;
     const char *return_addr, *hdr;
-    const char *value, *msgid, *orig_msgid, *boundary;
+    const char *value, *msgid, *orig_msgid, *boundary, *error;
     string_t *str;
     int ret;
 
@@ -180,5 +180,14 @@
     str_truncate(str, 0);
     str_printfa(str, "\r\n\r\n--%s--\r\n", boundary);
     o_stream_nsend(output, str_data(str), str_len(str));
-    return smtp_client_close(smtp_client);
+    if ((ret = smtp_client_deinit(smtp_client, &error)) < 0) {
+	    i_error("msgid=%s: Temporarily failed to send rejection: %s",
+		    orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80),
+		    str_sanitize(error, 512));
+    } else if (ret == 0) {
+	    i_info("msgid=%s: Permanently failed to send rejection: %s",
+		   orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80),
+		   str_sanitize(error, 512));
+    }
+    return ret < 0 ? -1 : 0;
 }


More information about the dovecot-cvs mailing list