hi everybody,
I changed the 0.2-stable release to allow multiple smtp servers instead of just one.
The servers are configured int main.inc.php analog to following exmaple:
$rcmail_config['smtp'] = array( 'default' => array( 'smtp_server' => 'localhost',
'smtp_port' => 25,
'smtp_user' => '%u',
'smtp_pass' => '%p',
'smtp_auth_type' => '',
'smtp_helo_host' => ''),
'gmail.com' => array( 'smtp_server' => 'smtp.googlemail.com',
'smtp_port' => 25,
'smtp_user' => '%u',
'smtp_pass' => '%p',
'smtp_auth_type' => '',
'smtp_helo_host' => '')
);
Which server should be used to send an email is determined by extracting the domain of the "from" address and then selecting the corresponding element in the array $rcmail_config['smtp']. If the element does not exsits, the default configuration is used instead.
The only file that needed to be changed is rcube_smtp.inc. The modified version and a diff is attached to this post.