From affbcfb2a237068efc94879ed6bf58f2ed33b0a6 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 17 Feb 2009 21:53:56 +0000 Subject: 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. --- usr.sbin/smtpd/smtp.c | 11 +++++------ usr.sbin/smtpd/smtp_session.c | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'usr.sbin') 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 @@ -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 @@ -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: -- cgit v1.2.3