Horde will automatically set-up the domain. in imp/config/servers.php....
$servers['imap'] = array(
'name' => 'IMAP Server',
'server' => 'localhost',
'protocol' => 'imap/notls',
'port' => 143,
'folders' => '',
'namespace' => '',
'maildomain' => 'domain.org',
'smtphost' => 'localhost',
'realm' => 'domain.org',
'preferred' => 'domain.org'
);
$servers['virtualdomain1'] = array(
'name' => 'IMAP Server',
'server' => 'localhost',
'protocol' => 'imap/notls',
'port' => 143,
'folders' => '',
'namespace' => '',
'maildomain' => 'virtualdomain1.org',
'smtphost' => 'localhost',
'realm' => 'virtualdomain1.org',
'preferred' => 'virtualdomain1.org'
);
As many entry's as you want. Horde will look at the 'preferred' entry and match it to the domain you used at the login screen. Then all the settings in the above entry will be unique to that domain. I used to have it set-up to login to a different server when using a virtual domain. Here is the entry in the conf.php file
// Should we display a list of servers (defined in config/servers.php)
// for users to choose from? The options are 'shown', 'hidden', and
// 'none'. If the server list is hidden then you can use the
// 'preferred' mechanism to auto-select from it based on an HTTP
// virtualhost or another piece of data. If it is shown, the user will
// be able to pick from any of the options. If none, no server list
// will be shown and the defaults will be used unless another
// mechanism changes them.
$conf['server']['server_list'] = 'hidden';
This is similiar on the new horde version 3 and imp 4.