Topic: API alias bug?
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
I'm working on migrating our existing mail server (sendmail/cyrus) to iRedMail. We have a bunch of aliases defined in our existing /etc/aliases file and I wanted to use the API to create those aliases in iRedMail. I discovered by accident that I can use "PUT" on /api/alias/<alias> even if the alias doesn't exist. This ends up creating a row in the forwardings table in the database but nothing in the alias table so it's not visible in the admin web interface. When I try to query it via the API I get a "NO_SUCH_ACCOUNT" error. If I do another PUT to update it will successfully update the forwardings table. If I then try to do a POST (to maybe create the alias) I get an "ALREADY_EXISTS" error. I can use DELETE to get rid of it from the forwardings table which is good since I wouldn't be able to do so from the admin interface.
I'm thinking maybe trying to PUT on a non-existent alias should probably return "NO_SUCH_ACCOUNT"?