Roundcube Community Forum

Release Support => Pending Issues => Topic started by: rjwill on September 15, 2011, 12:31:48 PM

Title: how can I alter imap port via plugin?
Post by: rjwill on September 15, 2011, 12:31:48 PM
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.
Title: how can I alter imap port via plugin?
Post by: rosali on September 15, 2011, 02:15:19 PM
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)
}
Title: how can I alter imap port via plugin?
Post by: rjwill on September 16, 2011, 12:45:48 PM
thanks, got it going.