nginx-0.1.44-RELEASE import

    *) Feature: the IMAP/POP3 proxy supports SSL.

    *) Feature: the "proxy_timeout" directive of the ngx_imap_proxy_module.

    *) Feature: the "userid_mark" directive.

    *) Feature: the $remote_user variable value is determined independently
       of authorization use.
diff --git a/auto/modules b/auto/modules
index dccb7a7..606149a 100644
--- a/auto/modules
+++ b/auto/modules
@@ -228,6 +228,14 @@
 if [ $IMAP = YES ]; then
     modules="$modules $IMAP_MODULES"
 
+    if [ $IMAP_SSL = YES ]; then
+        modules="$modules $IMAP_SSL_MODULE"
+        IMAP_DEPS="$IMAP_DEPS $IMAP_SSL_DEPS"
+        IMAP_SRCS="$IMAP_SRCS $IMAP_SSL_SRCS"
+        have=NGX_IMAP_SSL . auto/have
+        USE_OPENSSL=YES
+    fi
+
     modules="$modules $IMAP_AUTH_HTTP_MODULE"
     IMAP_SRCS="$IMAP_SRCS $IMAP_AUTH_HTTP_SRCS"
 
diff --git a/auto/options b/auto/options
index ad25cc2..2960f09 100644
--- a/auto/options
+++ b/auto/options
@@ -64,6 +64,7 @@
 HTTP_STUB_STATUS=NO
 
 IMAP=NO
+IMAP_SSL=NO
 
 NGX_ADDONS=
 
@@ -141,6 +142,7 @@
         --with-http_stub_status_module)  HTTP_STUB_STATUS=YES       ;;
 
         --with-imap)                     IMAP=YES                   ;;
+        --with-imap_ssl_module)          IMAP_SSL=YES               ;;
 
         --add-module=*)                  NGX_ADDONS="$NGX_ADDONS $value" ;;
 
diff --git a/auto/sources b/auto/sources
index 05889f3..806875d 100644
--- a/auto/sources
+++ b/auto/sources
@@ -346,6 +346,10 @@
            src/imap/ngx_imap_handler.c \
            src/imap/ngx_imap_parse.c"
 
+IMAP_SSL_MODULE="ngx_imap_ssl_module"
+IMAP_SSL_DEPS="src/imap/ngx_imap_ssl_module.h"
+IMAP_SSL_SRCS="src/imap/ngx_imap_ssl_module.c"
+
 IMAP_AUTH_HTTP_MODULE="ngx_imap_auth_http_module"
 IMAP_AUTH_HTTP_SRCS="src/imap/ngx_imap_auth_http_module.c"