Paste email address to select mail domain

When creating a mailbox I would like to paste in a full mail address in the email_local_part field and have it select the correct domain in the email_domain select box. The patch in the linked MR does that. When the email_local_part value changes it looks to see is an @ is present and splits the value on that.

The event is: onChange="javascript: if (/@/.test(this.value)) { parts = this.value.split('@'); $('#email_domain').val(parts.pop()); $('#email_domain').trigger('change'); this.value=parts.pop(); } "