So when a user logs onto Roundcube for the first time, they are added to the roundcube database, with the default identity. This identity is <username>@localhost. They can, of course, change this and setup more identities in the Settings, but they shouldn't have to. So I found a patch online and modied it slightly to detect the domainname used to get to roundcube and use that as the default domain. Its simply this:
// replace $rcmail_config['mail_domain'] = ''; with: $rcmail_config['mail_domain'] = preg_replace("/^[a-zA-Z]*\./i", "", $_SERVER['HTTP_HOST']);Pretty neat huh?