My webmail server is using multiple copies of imapproxy via localhost, on different ports that connect users to different backend mail nodes. I wrote a plugin that looks up the users and finds out what node they are on, and tries to make RC login to the required imap proxy, but I can't seem to get it working. I can't figure out a way to rewrite the imap port via any hooks. I see the smtp_connect hook has port, but imap_connect does not. Anyone know a way to do this? Thanks in advance.
I suggest to bind the plugin to 'public $task = 'mail' and then use 'startup' hook.
After that you could detect the action where you need to overwrite settings:
$rcmail::get_instance();
if($rcmail->action == 'myaction'){
$rcmail->config->set('mykey', 'myval'); // any key in config (main.inc.php)
}
thanks, got it going.