Mail alias-to-alias rewritten incorrectly

I’m having a problem when manually editing aliases in Virtualmin > Edit Mail Aliases.

I have an alias,, forwarded to my address, I also have other aliases, and, which forward to Creating these aliases seems to work fine, at least until I click Manually Edit Aliases. The addresses that appear are rewritten as:


If I click Save without changing anything, it states that it has in fact "Modified email alias" and, and their destinations become "test" instead of "". This basically corrupts all the aliases-to-aliases on the domain, because "test" alone is not a valid mailbox on the server.

(If I try to send mail to, it forwards this to "test", which is interpreted as "test@$mydomain", the global Postfix domain/hostname. This of course fails because no such mailbox exists.)

Is this a bug in the parsing of manually edited aliases? It seems that this function is "magical" behavior that might simplify other use cases, but in this case it renders the aliases undeliverable.