Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More options and faster (use IPs always)

  • Loading branch information...
commit d17bdf2b3735361f505490c8af4e45bf42508465 1 parent d1b4e17
moodler authored

Showing 1 changed file with 11 additions and 5 deletions. Show diff stats Hide diff stats

  1. +11 5 auth/imap/lib.php
16 auth/imap/lib.php
@@ -4,9 +4,9 @@
4 4 // This code is completely untested so far - I'm just jotting down ideas ...
5 5 // Looks like it should work though ...
6 6
7   -$CFG->auth_imaphost = "localhost";
8   -$CFG->auth_imapport = "143"; // 143, 993, 100, 119
9   -$CFG->auth_imaptype = "imap"; // imap, imapssl, pop3, nntp
  7 +$CFG->auth_imaphost = "127.0.0.1"; // Should be IP number
  8 +$CFG->auth_imaptype = "imap"; // imap, imapssl, imapcert, pop3, pop3cert, nntp
  9 +$CFG->auth_imapport = "143"; // 143, 993, 100, 119
10 10
11 11
12 12 function auth_user_login ($username, $password) {
@@ -22,15 +22,21 @@ function auth_user_login ($username, $password) {
22 22 case "imapssl":
23 23 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl}INBOX";
24 24 break;
  25 + case "imapcert":
  26 + $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl/novalidate-cert}INBOX";
  27 + break;
25 28 case "pop3":
26 29 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3}INBOX";
27 30 break;
  31 + case "pop3cert":
  32 + $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3/ssl/novalidate-cert}INBOX";
  33 + break;
28 34 case "nntp":
29   - $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/nntp}comp.test";
  35 + $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/nntp}";
30 36 break;
31 37 }
32 38
33   - if ($connection = imap_open($host, $username, $password)) {
  39 + if ($connection = imap_open($host, $username, $password, OP_HALFOPEN)) {
34 40 imap_close($connection);
35 41 return true;
36 42

0 comments on commit d17bdf2

Please sign in to comment.
Something went wrong with that request. Please try again.