From 0ad59c275bcbc27b63b6f99996eecc99ac559321 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 30 Dec 1998 21:24:40 +0000 Subject: Add more RFC1894. svn path=/trunk/; revision=2300 --- sink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sink.c') diff --git a/sink.c b/sink.c index 6ec32d87..2f5b7f9d 100644 --- a/sink.c +++ b/sink.c @@ -256,7 +256,7 @@ static int send_bouncemail(struct msgblk *msg, int userclass, /* bounce back an error report a la RFC 1892 */ { char daemon_name[18 + HOSTLEN] = "FETCHMAIL-DAEMON@"; - char boundary[BUFSIZ]; + char boundary[BUFSIZ], *ts; int i, sock; /* don't bounce in reply to undeliverable bounces */ @@ -280,6 +280,8 @@ static int send_bouncemail(struct msgblk *msg, int userclass, "om-mani-padme-hum-%d-%d-%ld", getpid(), getppid(), time((time_t *)NULL)); + ts = rfc822timestamp(); + if (outlevel >= O_VERBOSE) error(0, 0, "SMTP: (bounce-message body)"); @@ -320,6 +322,7 @@ static int send_bouncemail(struct msgblk *msg, int userclass, /* Minimum RFC1894 compliance + Diagnostic-Code field */ SockPrintf(sock, "\r\n"); SockPrintf(sock, "Final-Recipient: rfc822; %s\r\n", idp->id); + SockPrintf(sock, "Last-Attempt-Date: %s\r\n", ts); SockPrintf(sock, "Action: failed\r\n"); if (nerrors == 1) @@ -423,7 +426,9 @@ static int handle_smtp_error(struct query *ctl, struct msgblk *msg) * a future retrieval cycle. * * Bouncemail *might* be appropriate here as a delay - * notification. But it's not really necessary because + * notification (note; if we ever add this, we must make + * sure the RFC1894 Action field is "delayed" rather thwn + * "failed"). But it's not really necessary because * this is not an actual failure, we're very likely to be * able to recover on the next cycle. */ -- cgit v1.2.3