You can create a dummy mail alias example@webmail.domain1.com
for each domain that you have. Then go to the web section of the admin interface and configure a custom web path there. Finally put an index.php
file into the directory on the server and fill its contents with:
<?php
header("Location: https://box1.domaina.com/webmail");
?>
You can also create a single folder on the server, for example webmail-redirect
and put the file in there. Then after doing the admin interface step you can delete the folder you had to create and create a symbolic link to the webmail-redirect
folder instead.
cd /home/user-data/www
rmdir webmail.domain1.com
ln -s webmail-redirect webmail.domain1.com
This way you will have the php file on the server just once and all domains will use the same redirect, which makes it easier to change later.