diff options
author | 2009-01-28 22:27:56 +0000 | |
---|---|---|
committer | 2009-01-28 22:27:56 +0000 | |
commit | 263133b525003587819218218a6daf0c31f5d1f0 (patch) | |
tree | 11f67a45dcc314ca5b9adf8f3002ed197f703541 | |
parent | Reflect MPLS kernel changes. (diff) | |
download | wireguard-openbsd-263133b525003587819218218a6daf0c31f5d1f0.tar.xz wireguard-openbsd-263133b525003587819218218a6daf0c31f5d1f0.zip |
since we're expanding "relay via ssl foobar.org" into two mxhosts (one with
F_SSMTP on port 465 and one with F_STARTTLS on port 25) both mxhosts should
only retain the flag that they will use ("via ssl" means the mxhost before
expansion has both flags set). this will make mta_connect() simpler when we
bring ssl support in the way.
-rw-r--r-- | usr.sbin/smtpd/mta.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 30112447c74..f35bab8ebc9 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.16 2009/01/28 21:44:15 gilles Exp $ */ +/* $OpenBSD: mta.c,v 1.17 2009/01/28 22:27:56 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -943,7 +943,9 @@ mta_expand_mxarray(struct session *sessionp) } switch (mxhost.flags & F_SSL) { - case F_SSL: + case F_SSL: { + u_int8_t flags = mxhost.flags; + if (mxhost.ss.ss_family == AF_INET) { ssin->sin_port = htons(465); mxhost.ss = *(struct sockaddr_storage *)ssin; @@ -952,6 +954,7 @@ mta_expand_mxarray(struct session *sessionp) ssin6->sin6_port = htons(465); mxhost.ss = *(struct sockaddr_storage *)ssin6; } + mxhost.flags = flags & ~F_STARTTLS; sessionp->mxarray[j++] = mxhost; if (mxhost.ss.ss_family == AF_INET) { @@ -962,8 +965,10 @@ mta_expand_mxarray(struct session *sessionp) ssin6->sin6_port = htons(25); mxhost.ss = *(struct sockaddr_storage *)ssin6; } + mxhost.flags = flags & ~F_SSMTP; sessionp->mxarray[j++] = mxhost; break; + } case F_SSMTP: if (mxhost.ss.ss_family == AF_INET) { ssin->sin_port = htons(465); |