If you ran the webmail from a different server as the mail server, then yes, this would be very useful.
I currently just run a single mail server, and run the webmail on it.
Take a look
here. There are several people working on something similar, to grab the domain information form the http address and add it to the user name.
I like my solution the best, of course
, where I grab the header information, through it into an array, separated by periods, reverse it, then the array[0] is your tld (com, org, etc), array[1] is your next level of domain, etc.
You can grab this and then put it in the defualt host field, a crude code would be something like this
$tempDomain = array_reverse(explode(".",$_SERVER['HTTP_HOST']));
$rcmail_config['default_host'] = 'ssl://mail' . $tempDomain[1] '.' $tempDomain[0] . ':993';That is almost the exact code I use to grab the username_domain