Filter aliasdomains like the form does for API calls
Functions mail_user_update and mail_user_add accepted an alias domain as valid input. Adding a mailbox for such a domain worked but was not valid. An update call failed with 'SOAP Error: looks like we got no XML document'
I extended the domain validation query with a part from the query used in ./interface/web/mail/mail_user_edit.php line 80
$sql = "SELECT domain, server_id FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";