summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mta.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-08-08 23:02:44 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-08-08 23:02:44 +0000
commit463154e5e1c26625acf99f41dc49b7d9160b04c2 (patch)
tree917db32616195b29d65adb0e41797d4d448be146 /usr.sbin/smtpd/mta.c
parentc3e5fdbe01381d7e3f7bb7f98e28c249464835ea (diff)
- simplify a bit queue_message_update()
- make sure queue_message_update() creates bounces using bounce_record() - when mta sends update to queue and it sees that batch is flagged with F_BATCH_PERMFAIL, only update the envelope error message if it doesn't have F_MESSAGE_PERMFAIL set, otherwise we may lose the real reason why we failed for that recipient. There's cleanup to do around that old code, i'm sure we can get it simpler. this commit fixes a bug pea@ spotted where a bounce message would not display the reason of a failure when we generated it after failing to deliver a relayed message.
Diffstat (limited to 'usr.sbin/smtpd/mta.c')
-rw-r--r--usr.sbin/smtpd/mta.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c
index 7b1012da00b..0cc9cc0ac01 100644
--- a/usr.sbin/smtpd/mta.c
+++ b/usr.sbin/smtpd/mta.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta.c,v 1.66 2009/08/07 21:47:07 gilles Exp $ */
+/* $OpenBSD: mta.c,v 1.67 2009/08/08 23:02:43 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -819,6 +819,7 @@ mta_reply_handler(struct bufferevent *bev, void *arg)
case 550:
if (sessionp->s_state == S_RCPT) {
batchp->messagep->status = (S_MESSAGE_REJECTED|S_MESSAGE_PERMFAILURE);
+ log_debug("DOES NOT EXIST !!!: %s", line);
message_set_errormsg(batchp->messagep, "%s", line);
break;
}
@@ -1019,8 +1020,10 @@ mta_batch_update_queue(struct batch *batchp)
while ((messagep = TAILQ_FIRST(&batchp->messages)) != NULL) {
if (batchp->status == S_BATCH_PERMFAILURE) {
- messagep->status |= S_MESSAGE_PERMFAILURE;
- message_set_errormsg(messagep, "%s", batchp->errorline);
+ if ((messagep->status & S_MESSAGE_PERMFAILURE) == 0) {
+ messagep->status |= S_MESSAGE_PERMFAILURE;
+ message_set_errormsg(messagep, "%s", batchp->errorline);
+ }
}
if (batchp->status == S_BATCH_TEMPFAILURE) {