summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-09-04 19:11:33 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-09-04 19:11:33 +0000
commit4d2438b8d96eb3c3c28cfc2232d4305b5b78d369 (patch)
tree622bf0299ca740e8c80c74866a71876f450fc5e0
parent79331488de4f35cbcc9704337c87f4e0740d6de4 (diff)
Fix scheduling of bounces that could not be delivered.
ok gilles@
-rw-r--r--usr.sbin/smtpd/runner.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c
index 8d1b9c1b1c9..8174c467efe 100644
--- a/usr.sbin/smtpd/runner.c
+++ b/usr.sbin/smtpd/runner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: runner.c,v 1.66 2009/09/04 13:33:00 jacekm Exp $ */
+/* $OpenBSD: runner.c,v 1.67 2009/09/04 19:11:32 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -440,11 +440,18 @@ runner_dispatch_smtp(int sig, short event, void *p)
break;
switch (imsg.hdr.type) {
- case IMSG_SMTP_ENQUEUE:
- if (imsg.fd == -1 || ! bounce_session(env, imsg.fd,
- imsg.data))
- message_reset_flags(imsg.data);
+ case IMSG_SMTP_ENQUEUE: {
+ struct message *m = imsg.data;
+
+ IMSG_SIZE_CHECK(m);
+
+ if (imsg.fd < 0 || ! bounce_session(env, imsg.fd, m)) {
+ m->status = S_MESSAGE_TEMPFAILURE;
+ queue_message_update(m);
+ }
break;
+ }
+
default:
log_warnx("runner_dispatch_smtp: got imsg %d",
imsg.hdr.type);