From: moodler Date: Sun, 15 Aug 2004 17:21:01 +0000 (+0000) Subject: FIxes for POP3 from Rudy Scott http://moodle.org/mod/forum/discuss.php?d=9131 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=58a524be4d39854fb62017b2418762126457425f;p=moodle.git FIxes for POP3 from Rudy Scott http://moodle.org/mod/forum/discuss.php?d=9131 --- diff --git a/auth/pop3/config.html b/auth/pop3/config.html index 103375c348..ec0288b860 100644 --- a/auth/pop3/config.html +++ b/auth/pop3/config.html @@ -1,4 +1,4 @@ -auth_pop3host)) { $config->auth_pop3host = "127.0.0.1"; } @@ -8,6 +8,9 @@ if (!isset($config->auth_pop3port)) { $config->auth_pop3port = "110"; } + if (!isset($config->auth_pop3mailbox)) { + $config->auth_pop3mailbox = "INBOX"; + } ?>

auth_pop3host: @@ -47,6 +50,17 @@ + +

auth_pop3mailbox: + + + + + + + + +

: diff --git a/auth/pop3/lib.php b/auth/pop3/lib.php index bd78bc29d5..6c18d436ec 100644 --- a/auth/pop3/lib.php +++ b/auth/pop3/lib.php @@ -12,16 +12,21 @@ function auth_user_login ($username, $password) { foreach ($hosts as $host) { // Try each host in turn $host = trim($host); + + // remove any trailing slash + if (substr($host, -1) == '/') { + $host = substr($host, 0, strlen($host) - 1); + } switch ($CFG->auth_pop3type) { case "pop3": - $host = '{'.$host.":$CFG->auth_pop3port/pop3}INBOX"; + $host = '{'.$host.":$CFG->auth_pop3port/pop3}$CFG->auth_pop3mailbox"; break; case "pop3notls": - $host = '{'.$host.":$CFG->auth_pop3port/pop3/notls}INBOX"; + $host = '{'.$host.":$CFG->auth_pop3port/pop3/notls}$CFG->auth_pop3mailbox"; break; case "pop3cert": - $host = '{'.$host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX"; + $host = '{'.$host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}$CFG->auth_pop3mailbox"; break; } diff --git a/lang/en/auth.php b/lang/en/auth.php index ecd94b4ea5..79da8c2bf7 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -49,7 +49,7 @@ $string['auth_ldapextrafields'] = 'These fields are optional. You can choose to $string['auth_ldaptitle'] = 'Use an LDAP server'; $string['auth_manualdescription'] = 'This method removes any way for users to create their own accounts. All accounts must be manually created by the admin user.'; $string['auth_manualtitle'] = 'Manual accounts only'; -$string['auth_multiplehosts'] = 'Multiple hosts can be specified (eg host1.com;host2.com;host3.com'; +$string['auth_multiplehosts'] = 'Multiple hosts OR addresses can be specified (eg host1.com;host2.com;host3.com) or (eg xxx.xxx.xxx.xxx;xxx.xxx.xxx.xxx)'; $string['auth_nntpdescription'] = 'This method uses an NNTP server to check whether a given username and password is valid.'; $string['auth_nntphost'] = 'The NNTP server address. Use the IP number, not DNS name.'; $string['auth_nntpport'] = 'Server port (119 is the most common)'; @@ -58,7 +58,8 @@ $string['auth_nonedescription'] = 'Users can sign in and create valid accounts i $string['auth_nonetitle'] = 'No authentication'; $string['auth_pop3description'] = 'This method uses a POP3 server to check whether a given username and password is valid.'; $string['auth_pop3host'] = 'The POP3 server address. Use the IP number, not DNS name.'; -$string['auth_pop3port'] = 'Server port (110 is the most common)'; +$string['auth_pop3mailbox'] = 'Name of the mailbox to attempt a connection with. (usually INBOX)'; +$string['auth_pop3port'] = 'Server port (110 is the most common, 995 is common for SSL)'; $string['auth_pop3title'] = 'Use a POP3 server'; $string['auth_pop3type'] = 'Server type. If your server uses certificate security, choose pop3cert.'; $string['auth_user_create'] = 'Enable user creation';