Oh, never mind. Moodle apparently just took a while to recognise the new plugin. At some point it showed me an install dialogue after which 'imap2' was listed. It works now. This is what I changed (Moodle 2.8.8):
db/install.php:
- rename function
version.php:
- $plugin->component = 'auth_imap2';
lang/en/auth_imap.php:
- rename file to auth_imap2.php
- string['pluginname'] = 'IMAP server 2';
- rename $string['auth_imap2description']
config.html:
- replace occurrences of 'auth_imap' with 'auth_imap2'
auth.php:
- class auth_plugin_imap2 extends auth_plugin_base {
- function auth_plugin_imap2() {
$this->authtype = 'imap2';
$this->config = get_config('auth/imap2');
}
- replace occurrences of auth/imap with auth/imap2
As I said, authentication with two IMAP servers appears to work now. The only thing I couldn't get to work is the auth_imap2description string. On the config-page for the imap2 plugin it just shows "auth_imap2description" (there are two square brackets around the string, in case the moodle editor replaces them again with a link).
Good luck!