dovecot-1.1: deliver -e: Write the error string to stderr also w...

dovecot at dovecot.org dovecot at dovecot.org
Sun May 4 03:09:21 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/40929ce03622
changeset: 7474:40929ce03622
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 04 03:09:18 2008 +0300
description:
deliver -e: Write the error string to stderr also with tempfails.

diffstat:

1 file changed, 9 insertions(+), 4 deletions(-)
src/deliver/deliver.c |   13 +++++++++----

diffs (34 lines):

diff -r 1b15881ed93b -r 40929ce03622 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Sun May 04 03:00:32 2008 +0300
+++ b/src/deliver/deliver.c	Sun May 04 03:09:18 2008 +0300
@@ -1000,6 +1000,13 @@ int main(int argc, char *argv[])
 		}
 
 		error_string = mail_storage_get_last_error(storage, &error);
+
+		if (stderr_rejection) {
+			/* write to stderr also for tempfails so that MTA
+			   can log the reason if it wants to. */
+			fprintf(stderr, "%s\n", error_string);
+		}
+
 		if (error != MAIL_ERROR_NOSPACE ||
 		    getenv("QUOTA_FULL_TEMPFAIL") != NULL) {
 			/* Saving to INBOX should always work unless
@@ -1008,14 +1015,12 @@ int main(int argc, char *argv[])
 			return EX_TEMPFAIL;
 		}
 
+		/* we'll have to reply with permanent failure */
 		deliver_log(mail, "rejected: %s",
 			    str_sanitize(error_string, 512));
 
-		/* we'll have to reply with permanent failure */
-		if (stderr_rejection) {
-			fprintf(stderr, "%s\n", error_string);
+		if (stderr_rejection)
 			return EX_NOPERM;
-		}
 		ret = mail_send_rejection(mail, user, error_string);
 		if (ret != 0)
 			return ret < 0 ? EX_TEMPFAIL : ret;


More information about the dovecot-cvs mailing list