summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-02-17 21:53:56 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-02-17 21:53:56 +0000
commitaffbcfb2a237068efc94879ed6bf58f2ed33b0a6 (patch)
tree6b55c5e6e5d576dd967a8b482e6755540acae7fa /usr.sbin
parent17fec4d93635324efc6280bfb8435c659ebb94cd (diff)
after a message has been commited to queue, do not incondtionnally clear
the message id and uid immediately. only do it if session has been flagged with F_QUIT, otherwise session_pickup() will do it when in state S_DONE. this fixes a bug reported by pea@ where the message id was not displayed in the "message accepted for delivery" line.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/smtp.c11
-rw-r--r--usr.sbin/smtpd/smtp_session.c6
2 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c
index 80aa13864b1..860342fe1a8 100644
--- a/usr.sbin/smtpd/smtp.c
+++ b/usr.sbin/smtpd/smtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp.c,v 1.23 2009/02/15 10:32:23 jacekm Exp $ */
+/* $OpenBSD: smtp.c,v 1.24 2009/02/17 21:53:55 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -476,12 +476,11 @@ smtp_dispatch_queue(int sig, short event, void *p)
if (s == NULL)
fatal("smtp_dispatch_queue: session is gone");
- if (imsg.hdr.type == IMSG_QUEUE_COMMIT_MESSAGE) {
- s->s_msg.message_id[0] = '\0';
- s->s_msg.message_uid[0] = '\0';
- }
-
if (s->s_flags & F_QUIT) {
+ if (imsg.hdr.type == IMSG_QUEUE_COMMIT_MESSAGE) {
+ s->s_msg.message_id[0] = '\0';
+ s->s_msg.message_uid[0] = '\0';
+ }
session_destroy(s);
break;
}
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 0b3ec23bb48..914c04d5b87 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.53 2009/02/13 19:59:49 jacekm Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.54 2009/02/17 21:53:55 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -732,10 +732,10 @@ session_pickup(struct session *s, struct submit_status *ss)
case S_DONE:
s->s_state = S_HELO;
- s->s_msg.message_id[0] = '\0';
session_respond(s, "250 %s Message accepted for delivery",
s->s_msg.message_id);
-
+ s->s_msg.message_id[0] = '\0';
+ s->s_msg.message_uid[0] = '\0';
break;
default: