summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mta_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd/mta_session.c')
-rw-r--r--usr.sbin/smtpd/mta_session.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c
index 3ca6fc0cf95..029ddbb6ef8 100644
--- a/usr.sbin/smtpd/mta_session.c
+++ b/usr.sbin/smtpd/mta_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mta_session.c,v 1.16 2012/09/11 16:24:28 eric Exp $ */
+/* $OpenBSD: mta_session.c,v 1.17 2012/09/21 12:33:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -853,18 +853,17 @@ mta_status(struct mta_session *s, int connerr, const char *fmt, ...)
static void
mta_envelope_done(struct mta_task *task, struct envelope *e, const char *status)
{
- struct mta_host *host = TAILQ_FIRST(&task->session->hosts);
+ struct mta_host *host = TAILQ_FIRST(&task->session->hosts);
+ char relay[MAX_LINE_SIZE], stat[MAX_LINE_SIZE];
envelope_set_errormsg(e, "%s", status);
- log_info("%016" PRIx64 ": to=<%s@%s>, delay=%s, relay=%s [%s], stat=%s (%s)",
- e->id, e->dest.user,
- e->dest.domain,
- duration_to_text(time(NULL) - e->creation),
- host->fqdn,
- ss_to_text(&host->sa),
+ snprintf(relay, sizeof relay, "relay=%s [%s], ",
+ host->fqdn, ss_to_text(&host->sa));
+ snprintf(stat, sizeof stat, "%s (%s)",
mta_response_status(e->errorline),
mta_response_text(e->errorline));
+ log_envelope(e, relay, stat);
imsg_compose_event(env->sc_ievs[PROC_QUEUE],
mta_response_delivery(e->errorline), 0, 0, -1, e, sizeof(*e));