diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-01-28 22:27:57 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-01-28 22:27:57 +0000 |
commit | 5449391530863d4cb727c37167b369ede66fd832 (patch) | |
tree | d369f4562094b80974168f0db623b650acaf7b87 | |
parent | 486f420bee10d11f17d1ba0131a48da77720dbf8 (diff) |
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); |