mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.

Home Page:https://mailinabox.email/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aliases and users with the same address are not checked for

ddavness opened this issue · comments

Right now you can create an user, let's say user@example.com and also create an alias user@example.com (and vice-versa).

Reproduction:

  • Create an user via the Users control panel. Let's call it user@example.com.
  • Create an alias user@example.com. It shares the same address as the user.
    • Expected behavior: The alias is not created (and the endpoint returns an error), because it's address already exists as an user.
    • Actual behavior: The alias is created like nothing happened.

Proposed Resolution: Check in add_mail_user() and add_mail_alias() whether the target address exists on the aliases and users table, respectively.

This is desirable and working behaviour IMO allows the person in charge of the address to receive and manage emails while also forwarding to anyone else who needs a copy.