I use roundcube for a company that runs two different mail server.
Now I want that some of the users automatically use the first mail server and the other use the second one.
Can the choice of IMAP and SMTP occur automatically in response to a specific user?
i'm not sure of its what you mean but you could try this plugin http://www.roundcubeforum.net/7-third-party-contributions/46-api-based-plugins/5718-simple-multiple-domains-login.html that sets the IMAP host based on the URL used to access the site. In any case, a plugin is the way forward so this should get you started.