In defaults you can see:
// To specify different SMTP servers for different IMAP hosts provide an array
// of IMAP host (no prefix or port) and SMTP server e.g. ['imap.example.com' => 'smtp.example.net']
so one way i think you must use config like this:
$config['smtp_host'] = array(
['hostname1.com'=>'hostname1.com'],
['hostname2.com'=>'hostname2.com']
);
Second way if your IMAP and SMTP servers on one host for ever domain - like imap and smtp on mail.domain1.com (not on imap.domain1.com and smtp.domain1.com) and you can try this:
// The IMAP host (and optionally port number) chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// If port number is omitted it will be set to 993 (for ssl://) or 143 otherwise.
$config['imap_host'] = array(
'ssl://hostname1.com',
'ssl://hostname2.com'
);
// SMTP server host (and optional port number) for sending mails.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// If port number is omitted it will be set to 465 (for ssl://) or 587 otherwise.
// Supported replacement variables:
// %h - user's IMAP hostname
$config['smtp_host'] = '%h';
and don't forget about smtp auth:
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
// $config['smtp_user'] = '%u';
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
//$config['smtp_pass'] = '%p';
$config['smtp_pass'] = '%p';
And you check yous SMTP with another client (outlook and etc) - it work, sure ?
And what you see in smtp logs ?
Hi,
I have tried the different configurations that you have suggested, however, I am still facing the issue with the SMTP server not being able to take the credentials for the second and third servers. I am currently in a shared hosting environment and my rights are limited in viewing the logs. However, I have tested the credentials for the second and third servers in Thunderbird and they are working without any issues.
Based on my current configuration:
php
$config['imap_host'] = array(
'ssl://hostname1.com:993',
'ssl://hostname2.com:993',
'ssl://hostname3.com:993'
);
$config['smtp_host'] = '%h';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
I am still not able to send emails from the second and third servers, however, now I am able to completely send from the first one that is provided in the IMAP settings. I would greatly appreciate your further assistance in resolving this issue.
Thanks,