]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Merge commit 'refs/merge-requests/3' of git://gitorious.org/dma/dma
authorSimon Schubert <2@0x2c.org>
Tue, 15 Nov 2011 21:44:08 +0000 (22:44 +0100)
committerSimon Schubert <2@0x2c.org>
Tue, 15 Nov 2011 21:44:08 +0000 (22:44 +0100)
net.c

diff --git a/net.c b/net.c
index 1622b7c72c897a56845782c5e778229049ecbb60..985c5393ac2ce073c1e2e406261cf73c459c362b 100644 (file)
--- a/net.c
+++ b/net.c
@@ -379,10 +379,13 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
        }
 
        /* Check first reply from remote host */
-       config.features |= NOSSL;
-       READ_REMOTE_CHECK("connect", 2);
+       if ((config.features & SECURETRANS) == 0 ||
+           (config.features & STARTTLS) != 0) {
+               config.features |= NOSSL;
+               READ_REMOTE_CHECK("connect", 2);
 
-       config.features &= ~NOSSL;
+               config.features &= ~NOSSL;
+       }
 
        if ((config.features & SECURETRANS) != 0) {
                error = smtp_init_crypto(fd, config.features);
@@ -390,6 +393,9 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
                        syslog(LOG_DEBUG, "SSL initialization successful");
                else
                        goto out;
+
+               if ((config.features & STARTTLS) == 0)
+                       READ_REMOTE_CHECK("connect", 2);
        }
 
        /* XXX allow HELO fallback */