diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-08-06 14:12:49 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-08-06 14:12:49 +0000 |
commit | 9c4ad90e43932a82d8ada4b21e1b107ea94b8252 (patch) | |
tree | 65675b74334ee29547d56e0c4cfb65e46c566e32 /usr.sbin/smtpd/bounce.c | |
parent | c2bde9abdefaba3e926607c03f01b078bae29015 (diff) |
- introduce message_set_errormsg() to set the error description that will
appear in a bounce message, and message_get_errormsg() to retrieve that
message.
- when loop is detected, call message_set_errormsg()
- in mta, call message_set_errormsg() for each recipient failure
- in mta, call message_set_errormsg() to copy batch errors to recipients if
we failed to deliver for a session related error
- when bouncing, add the recipient and error reason to the bounce message
Diffstat (limited to 'usr.sbin/smtpd/bounce.c')
-rw-r--r-- | usr.sbin/smtpd/bounce.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c index 360bfe18402..3182a0dce10 100644 --- a/usr.sbin/smtpd/bounce.c +++ b/usr.sbin/smtpd/bounce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bounce.c,v 1.1 2009/08/06 13:40:45 gilles Exp $ */ +/* $OpenBSD: bounce.c,v 1.2 2009/08/06 14:12:48 gilles Exp $ */ /* * Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org> @@ -143,6 +143,12 @@ bounce_session_switch(struct smtpd *env, FILE *fp, enum session_state *state, ch fprintf(fp, "This is the MAILER-DAEMON, please DO NOT REPLY t this e-mail.\r\n"); fprintf(fp, "An error has occurred while attempting to deliver a message.\r\n"); fprintf(fp, "\r\n"); + fprintf(fp, "Recipient: %s@%s\r\n", messagep->recipient.user, + messagep->recipient.domain); + fprintf(fp, "Reason:\r\n"); + fprintf(fp, "%s\r\n", messagep->session_errorline); + + fprintf(fp, "\r\n"); fprintf(fp, "Below is a copy of the original message:\r\n\r\n"); if (! file_copy_session(env, fp, srcfp)) { |