I noticed that there is a difference in the way the email aliases are handled between the user interface (UI) and the command line interface (CLI) as administrator .
As administrator, I can add aliases from either my YunoHost UI panel, or via CLI with
yunohost user update USERNAME --add-alias "USERNAMEALIAS@DOMAIN.TLD".
Here is the “issue”:
- with the UI, I can add any alias I want within either the domain I am assigned to as a user, or within the main YunoHost domain (the one chosen as “principal” in the YunoHost Domains administration panel). If I chose any other domain (which nevertheless exists in my YunoHost Domains’ list), the UI returns the error
Invalid domain in alias@domain,
- with the CLI, I can add any alias I want on the condition that I chose a domain present in my YunoHost Domains’ list. Therefore there is less limitation.
Here is the reason why I point this out: I wanted to receive the emails sent to
root by my server’s cron jobs. So I had to create the alias
root@hostname (that very hostname defined in
/etc/hostname) for my user email address. But since
hostname is neither my user’s domain, nor my YunoHost principal domain, I couldn’t do it from the user interface, unless I created I new domain called
hostname and made it my principal YunoHost domain, which I didn’t want.
So, for that matter, I added that
hostname as a regular domain in YunoHost, and used the CLI to add the alias
root@hostname to my user email address. Another way of doing it would have been to change my server hostname to match my principal YunoHost domain.
Finally, I noticed that if I add an alias to a user with CLI using a domain which is neither the YunoHost principal domain, nor the domain corresponding to the user, 1) it works (as mentioned above in the second point) and 2) I can then add other aliases with the UI using that domain, even though the UI would not let me do so in the first place, before using CLI.
Hope all this make any sense for you guys – sorry for the vvverbosity!