toteph42 / identy_switch

This plugin allows users to switch between different accounts (and check for new mails) in a single Roundcube session.
GNU General Public License v3.0
6 stars 3 forks source link

SMTP problems after identity switch #26

Open davideciannamea opened 3 days ago

davideciannamea commented 3 days ago

Hello and thank you for this plugin.

In my RoundCube I have successfully installed this plugin and configured a dozen IMAP accounts in the main login account.

I have noticed this behavior: when I use my main account, which I have logged into RoundCube, and send an email by selecting an IMAP account added with this plugin, sending the email works; whereas if I first make a switch of an IMAP account added with this plugin and go to send an email, sending the email does not work properly.

Why? Is it possible with this plugin to go and read global SMTP configurations? My Postfix configuration is that to use SMTP I use a Relay to an external mail endpoint.

Regards, Davide

toteph42 commented 3 days ago

Hi, yes you can specify SMTP setting in config.inc.php. Please check out samples in config.inc.php.dist.

davideciannamea commented 2 days ago

Hi, in my global configuration I have:

$config['smtp_server'] = 'localhost'; $config['smtp_port'] = 587; $config['smtp_user'] = '%u'; $config['smtp_pass'] = '%p'; $config['smtp_auth_type'] = 'LOGIN'; $config['smtp_conn_options'] = [ 'ssl' => [ 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false, ], ]; I have this configuration in RoundCube's global config.inc.php and I saw that a classic configuration to communicate with the external endpoint, if Postfix configured it in Relay; this approach is working.

In the your plugin I tried the following configuration:

'*' => [ 'imap' => '*', 'smtp' => '*', 'delimiter' => '/', ],

but when I switch IMAP identity and afterwards go to “New Message” the system still tells me “SMTP Error - Connection to server failed”. Where am I going wrong?

Thanks

toteph42 commented 2 days ago

Hi, first of all, if you use plugin config file, you must specify schema (ssl:, tls:or imap:).

During normal processing the domain configuration is not used. To clarify I added a text to config.inc.php.dist:

// Please note: // - Using config.inc.php is only done, when you enter identy_switch configuration penel! // - On Startup of RoundCube all configuration parameters were loaded from data base, so changes to this // configuration file does not apply.

In your case, you must specify something like 'smtp' => 'ssl://localhost:587'. Check setting in identity_switch configuration panel. There you can see, what is used. Or enable debugging and check logging/identy_switch.log.