I've attached a patch which adds SSL support.  It depends on the module
Net::SSLeay::Handle, so I don't know if it's acceptable to Debian or
upstream.

De

--- imap_local.monitor  2012-03-14 18:01:02.000000000 -0400
+++ imap_local_ssl.monitor      2012-03-14 19:13:05.000000000 -0400
@@ -36,8 +36,9 @@
 #
 use Getopt::Std;
 use English;
+use Net::SSLeay::Handle;
 
-getopts ("m:p:t:u:w:");
+getopts ("m:p:t:u:w:s");
 $PORT = $opt_p || 143;
 $TIMEOUT = $opt_t || 30;
 $MAILBOX=$opt_m || undef;
@@ -182,10 +183,17 @@
 
     my $that = sockaddr_in ($Port, $OtherHostAddr);
 
-    $result = socket(S, &PF_INET, &SOCK_STREAM, $proto) || return undef;
-
-    $result = connect(S, $that) || return undef;
-
+    if ($opt_s)
+    {
+        tie(*S, "Net::SSLeay::Handle", $OtherHostname, $Port) ||
+            return undef;
+    }
+    else
+    {
+        $result = socket(S, &PF_INET, &SOCK_STREAM, $proto) || return undef;
+    
+        $result = connect(S, $that) || return undef;
+    }
     select(S); $| = 1; select(STDOUT);      # set S to be un-buffered
     return 1;                               # success
 }

Reply via email to