From f71aa9f0d880ba89e8b84746c193ef1f1bbb6604 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Wed, 28 Jan 2009 17:43:46 +0000 Subject: relayhost flags were not properly copied to the relayhost array of the batch we're handing over to mta. this prevented mta from knowing if a session has to be established over ssl or not. --- usr.sbin/smtpd/lka.c | 6 +++++- usr.sbin/smtpd/runner.c | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index d4519f611d2..05b8e30414d 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.18 2009/01/08 19:17:31 jacekm Exp $ */ +/* $OpenBSD: lka.c,v 1.19 2009/01/28 17:43:45 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -463,6 +463,10 @@ lka_dispatch_runner(int sig, short event, void *p) log_debug("resolving MX: %s", mx[i]); for (resp = res; resp != NULL; resp = resp->ai_next) { + + if (batchp->rule.r_action == A_RELAYVIA) + batchp->mxarray[j].flags = batchp->rule.r_value.relayhost.flags; + if (resp->ai_family == PF_INET) { struct sockaddr_in *ssin; diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index a26063e3414..e7dffffdc67 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.25 2009/01/28 17:29:11 jacekm Exp $ */ +/* $OpenBSD: runner.c,v 1.26 2009/01/28 17:43:45 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -560,6 +560,7 @@ runner_process_runqueue(struct smtpd *env) message.lasttry = tm; message.flags &= ~F_MESSAGE_SCHEDULED; message.flags |= F_MESSAGE_PROCESSING; + if (! queue_update_envelope(&message)) continue; @@ -702,8 +703,10 @@ runner_batch_resolved(struct smtpd *env, struct batch *lookup) switch (batchp->getaddrinfo_error) { case 0: batchp->flags |= F_BATCH_RESOLVED; - for (i = 0; i < batchp->mx_cnt; ++i) + for (i = 0; i < batchp->mx_cnt; ++i) { + batchp->mxarray[i].flags = lookup->mxarray[i].flags; batchp->mxarray[i].ss = lookup->mxarray[i].ss; + } break; case EAI_ADDRFAMILY: case EAI_BADFLAGS: -- cgit v1.2.3