summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/smtpd/queue.c8
-rw-r--r--usr.sbin/smtpd/scheduler.c4
-rw-r--r--usr.sbin/smtpd/smtp_session.c11
3 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c
index e1f73b6fafd..f23a8daa52f 100644
--- a/usr.sbin/smtpd/queue.c
+++ b/usr.sbin/smtpd/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.129 2012/08/24 18:26:01 eric Exp $ */
+/* $OpenBSD: queue.c,v 1.130 2012/08/24 18:46:46 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -76,7 +76,11 @@ queue_imsg(struct imsgev *iev, struct imsg *imsg)
return;
case IMSG_QUEUE_REMOVE_MESSAGE:
- queue_message_incoming_delete(evpid_to_msgid(e->id));
+ msgid = *(uint32_t*)(imsg->data);
+ queue_message_incoming_delete(msgid);
+ imsg_compose_event(env->sc_ievs[PROC_SCHEDULER],
+ IMSG_QUEUE_REMOVE_MESSAGE, 0, 0, -1,
+ &msgid, sizeof msgid);
return;
case IMSG_QUEUE_COMMIT_MESSAGE:
diff --git a/usr.sbin/smtpd/scheduler.c b/usr.sbin/smtpd/scheduler.c
index f3b4d933f03..848e440aba9 100644
--- a/usr.sbin/smtpd/scheduler.c
+++ b/usr.sbin/smtpd/scheduler.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scheduler.c,v 1.16 2012/08/24 18:21:06 eric Exp $ */
+/* $OpenBSD: scheduler.c,v 1.17 2012/08/24 18:46:46 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -88,7 +88,7 @@ scheduler_imsg(struct imsgev *iev, struct imsg *imsg)
scheduler_reset_events();
return;
- case IMSG_QUEUE_TEMPFAIL:
+ case IMSG_QUEUE_REMOVE_MESSAGE:
msgid = *(uint32_t *)(imsg->data);
log_trace(TRACE_SCHEDULER, "scheduler: aborting msg:%08" PRIx32,
msgid);
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 24e8e993117..055f73fad39 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.166 2012/08/19 14:16:58 chl Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.167 2012/08/24 18:46:46 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -991,6 +991,8 @@ session_read_data(struct session *s, char *line)
void
session_destroy(struct session *s, const char * reason)
{
+ uint32_t msgid;
+
log_debug("smtp: %p: deleting session: %s", s, reason);
if (s->s_flags & F_ZOMBIE)
@@ -999,10 +1001,11 @@ session_destroy(struct session *s, const char * reason)
if (s->datafp != NULL)
fclose(s->datafp);
- if (s->s_msg.id != 0 && s->s_state != S_DONE)
+ if (s->s_msg.id != 0 && s->s_state != S_DONE) {
+ msgid = evpid_to_msgid(s->s_msg.id);
imsg_compose_event(env->sc_ievs[PROC_QUEUE],
- IMSG_QUEUE_REMOVE_MESSAGE, 0, 0, -1, &s->s_msg,
- sizeof(s->s_msg));
+ IMSG_QUEUE_REMOVE_MESSAGE, 0, 0, -1, &msgid, sizeof(msgid));
+ }
if (s->s_ssl) {
if (s->s_l->flags & F_SMTPS)