[dovecot-cvs] dovecot-1.0: If input mail gets lost somehow, log a real error i...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 13 14:27:24 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/7959ec38de98
changeset: 5308:7959ec38de98
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 13 14:27:21 2007 +0300
description:
If input mail gets lost somehow, log a real error instead of "Unknown
error".

diffstat:

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

diffs (28 lines):

diff -r c23926d0aed2 -r 7959ec38de98 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Wed Jun 13 03:48:31 2007 +0300
+++ b/src/deliver/deliver.c	Wed Jun 13 14:27:21 2007 +0300
@@ -130,7 +130,7 @@ int deliver_save(struct mail_storage *st
 	kw = strarray_length(keywords) == 0 ? NULL :
 		mailbox_keywords_create(t, keywords);
 	if (mailbox_copy(t, mail, flags, kw, NULL) < 0)
-		ret = -1;
+		ret = mail->expunged ? -2 : -1;
 	mailbox_keywords_free(t, &kw);
 
 	if (ret < 0)
@@ -145,10 +145,13 @@ int deliver_save(struct mail_storage *st
 	if (ret == 0)
 		i_info("msgid=%s: saved mail to %s", msgid, mailbox_name);
 	else {
+		const char *error;
 		bool syntax, temp;
 
-		i_info("msgid=%s: save failed to %s: %s", msgid, mailbox_name,
-		       mail_storage_get_last_error(storage, &syntax, &temp));
+		error = ret == -2 ? "BUG: Input mail got lost unexpectedly" :
+			mail_storage_get_last_error(storage, &syntax, &temp);
+		i_info("msgid=%s: save failed to %s: %s",
+		       msgid, mailbox_name, error);
 	}
 
 	mailbox_close(&box);


More information about the dovecot-cvs mailing list