[dovecot-cvs] dovecot/src/deliver deliver.c, 1.28, 1.29 mail-send.c, 1.2, 1.3
tss at dovecot.org
tss at dovecot.org
Sun Oct 8 21:09:52 UTC 2006
Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv24604
Modified Files:
deliver.c mail-send.c
Log Message:
Log all mail saves and save failures.
Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/deliver.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- deliver.c 8 Oct 2006 19:24:37 -0000 1.28
+++ deliver.c 8 Oct 2006 20:09:48 -0000 1.29
@@ -11,6 +11,7 @@
#include "istream-seekable.h"
#include "module-dir.h"
#include "str.h"
+#include "str-sanitize.h"
#include "var-expand.h"
#include "message-address.h"
#include "dict-client.h"
@@ -104,6 +105,7 @@
struct mailbox *box;
struct mailbox_transaction_context *t;
struct mail_keywords *kw;
+ const char *msgid;
int ret = 0;
box = mailbox_open_or_create_synced(storage, mailbox);
@@ -123,6 +125,12 @@
else
ret = mailbox_transaction_commit(&t, 0);
+ msgid = mail_get_first_header(mail, "Message-ID");
+ i_info(ret < 0 ? "msgid=%s: save failed to %s" :
+ "msgid=%s: saved mail to %s",
+ msgid == NULL ? "" : str_sanitize(msgid, 80),
+ str_sanitize(mailbox_get_name(box), 80));
+
mailbox_close(&box);
return ret;
}
Index: mail-send.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/mail-send.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mail-send.c 16 Jun 2006 09:30:07 -0000 1.2
+++ mail-send.c 8 Oct 2006 20:09:49 -0000 1.3
@@ -4,6 +4,7 @@
#include "ioloop.h"
#include "hostpid.h"
#include "istream.h"
+#include "str-sanitize.h"
#include "message-date.h"
#include "message-size.h"
#include "duplicate.h"
@@ -31,13 +32,16 @@
struct message_size hdr_size;
const char *return_addr, *str;
const unsigned char *data;
- const char *msgid, *boundary;
+ const char *msgid, *orig_msgid, *boundary;
size_t size;
int ret;
+ orig_msgid = mail_get_first_header(mail, "Message-ID");
return_addr = deliver_get_return_address(mail);
if (return_addr == NULL) {
- i_info("Return-Path missing, rejection reason: %s", reason);
+ i_info("msgid=%s: Return-Path missing, rejection reason: %s",
+ orig_msgid == NULL ? "" : str_sanitize(orig_msgid, 80),
+ str_sanitize(reason, 512));
return -1;
}
@@ -80,9 +84,8 @@
fprintf(f, "Original-Recipient: rfc822; %s\r\n", str);
fprintf(f, "Final-Recipient: rfc822; %s\r\n", recipient);
- str = mail_get_first_header(mail, "Message-ID");
- if (str != NULL)
- fprintf(f, "Original-Message-ID: %s\r\n", str);
+ if (orig_msgid != NULL)
+ fprintf(f, "Original-Message-ID: %s\r\n", orig_msgid);
fprintf(f, "Disposition: "
"automatic-action/MDN-sent-automatically; deleted\r\n");
fprintf(f, "\r\n");
More information about the dovecot-cvs
mailing list