summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/smtpd/bounce.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index 38ab5b5aac8..8635b8777ba 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.71 2015/12/24 16:54:37 mmcc Exp $ */
+/* $OpenBSD: bounce.c,v 1.72 2016/02/03 05:57:09 sunil Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -149,12 +149,16 @@ bounce_add(uint64_t evpid)
key.bounce = evp.agent.bounce;
key.smtpname = evp.smtpname;
- if (evp.errorline[0] == '4')
+ switch (evp.esc_class) {
+ case ESC_STATUS_OK:
+ key.bounce.type = B_DSN;
+ break;
+ case ESC_STATUS_TEMPFAIL:
key.bounce.type = B_WARNING;
- else if (evp.errorline[0] == '5')
+ break;
+ default:
key.bounce.type = B_ERROR;
- else
- key.bounce.type = B_DSN;
+ }
key.bounce.dsn_ret = evp.dsn_ret;
key.bounce.expire = evp.expire;