summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2013-12-03 08:32:41 +0000
committerEric Faurot <eric@cvs.openbsd.org>2013-12-03 08:32:41 +0000
commitd912cf35ad71d03ef97f0f7bd6d3a8843392b115 (patch)
tree8d700ad4f03c3887dfada9c1f86a944989da00c7
parentd2691ac140877e978fb1760a3b8839703bec2157 (diff)
warn when failing to enqueue an internal bounce.
-rw-r--r--usr.sbin/smtpd/bounce.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index 0daf1bd2bc9..809644eadea 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.59 2013/11/06 10:01:29 eric Exp $ */
+/* $OpenBSD: bounce.c,v 1.60 2013/12/03 08:32:40 eric Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -508,11 +508,7 @@ bounce_delivery(struct bounce_message *msg, int delivery, const char *status)
struct bounce_envelope *be;
struct envelope evp;
size_t n;
-
- log_debug("debug: bounce: status %s for message %08"PRIx32": %s",
- imsg_to_str(delivery),
- msg->msgid,
- status);
+ const char *f;
n = 0;
while ((be = TAILQ_FIRST(&msg->envelopes))) {
@@ -540,6 +536,19 @@ bounce_delivery(struct bounce_message *msg, int delivery, const char *status)
n += 1;
}
+
+ if (delivery == IMSG_DELIVERY_TEMPFAIL)
+ f = "TempFail";
+ else if (delivery == IMSG_DELIVERY_PERMFAIL)
+ f = "PermFail";
+ else
+ f = NULL;
+
+ if (f)
+ log_warnx("warn: %s injecting failure report on message %08"PRIx32
+ " to <%s> for %zu envelope%s: %s",
+ f, msg->msgid, msg->to, n, n > 1 ? "s":"", status);
+
nmessage -= 1;
stat_decrement("bounce.message", 1);
stat_decrement("bounce.envelope", n);