More options and faster (use IPs always)
authormoodler <moodler>
Fri, 15 Nov 2002 08:59:30 +0000 (08:59 +0000)
committermoodler <moodler>
Fri, 15 Nov 2002 08:59:30 +0000 (08:59 +0000)
auth/imap/lib.php

index a2e7c8e..cdf3161 100644 (file)
@@ -4,9 +4,9 @@
 // This code is completely untested so far - I'm just jotting down ideas ...
 // Looks like it should work though ...
 
 // This code is completely untested so far - I'm just jotting down ideas ...
 // Looks like it should work though ...
 
-$CFG->auth_imaphost   = "localhost";
-$CFG->auth_imapport   = "143";     // 143, 993, 100, 119
-$CFG->auth_imaptype   = "imap";    // imap, imapssl, pop3, nntp
+$CFG->auth_imaphost   = "127.0.0.1";  // Should be IP number
+$CFG->auth_imaptype   = "imap";       // imap, imapssl, imapcert, pop3, pop3cert, nntp
+$CFG->auth_imapport   = "143";        // 143, 993, 100, 119
 
 
 function auth_user_login ($username, $password) {
 
 
 function auth_user_login ($username, $password) {
@@ -22,15 +22,21 @@ function auth_user_login ($username, $password) {
         case "imapssl":
             $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl}INBOX";
         break;
         case "imapssl":
             $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl}INBOX";
         break;
+        case "imapcert":
+            $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl/novalidate-cert}INBOX";
+        break;
         case "pop3":
             $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3}INBOX";
         break;
         case "pop3":
             $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3}INBOX";
         break;
+        case "pop3cert":
+            $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3/ssl/novalidate-cert}INBOX";
+        break;
         case "nntp":
         case "nntp":
-            $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/nntp}comp.test";
+            $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/nntp}";
         break;
     }
 
         break;
     }
 
-    if ($connection = imap_open($host, $username, $password)) {
+    if ($connection = imap_open($host, $username, $password, OP_HALFOPEN)) {
         imap_close($connection);
         return true;
 
         imap_close($connection);
         return true;