summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-02 03:03:38 +0100
committerAraq <rumpf_a@web.de>2014-02-02 03:03:38 +0100
commit4b94aba6de5da797c339dc6645e72b1070b92c31 (patch)
tree749e36043ea4efd1eb30bf90628412f933f1c2ab /lib
parent69bc0779378bf3684d2138d2b6c0a423ae56f2c6 (diff)
downloadNim-4b94aba6de5da797c339dc6645e72b1070b92c31.tar.gz
fixes #735
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/smtp.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/smtp.nim b/lib/pure/smtp.nim
index 6a3f65279..88afeb589 100644
--- a/lib/pure/smtp.nim
+++ b/lib/pure/smtp.nim
@@ -66,13 +66,15 @@ proc checkReply(smtp: var TSMTP, reply: string) =
   if not line.string.startswith(reply):
     quitExcpt(smtp, "Expected " & reply & " reply, got: " & line.string)
 
+const compiledWithSsl = defined(ssl)
+
 proc connect*(address: string, port = 25, 
               ssl = false, debug = false): TSMTP =
   ## Establishes a connection with a SMTP server.
   ## May fail with EInvalidReply or with a socket error.
   result.sock = socket()
   if ssl:
-    when defined(ssl):
+    when compiledWithSsl:
       let ctx = newContext(verifyMode = CVerifyNone)
       ctx.wrapSocket(result.sock)
     else: