Hi,
from what I understood, there is not much interest in supporting the configuration of an SMTP server as part of an identity in roundcube. That's perfectly fine thanks to the plugin system, which can make use of the smtp_connect hook. But to use it, this hook needs to tell the plugin what the current identity is, e.g. by passing $from. This approach is a) sort of obvious and b) has been shown to work here http://nixbioinf.org/cgit/cgit.cgi/roundcubemail-0.3.1_multismtp/.
Attached patch (wrt the trunk) does just that. It simply introduces an optional argument to connect; it's a stripped down version of above patch, moving as much as possible into a future (trivial) plugin.
The patch might also fix a general problem where an smtp object exists, but because smtp_init() was called with $connect == false there is no SMTP connection. I know roundcube doesn't do it, but it's theoretically possible - so it should either test for the smtp object being connected or remove the $connect parameter from smtp_init() altogether.
Please don't take that patch as is - I did not test it at all, it's a mere suggestion to sketch a possible implementation. I obviously expect no acknowledgment for it :-)
Cheers, Axel.
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/Ht/Z9BeoZc3/connect_alias.diff Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/