1

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"?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: API alias bug?

One additional issue with aliases -- I can't have a member of an alias use a '+' in the local part (i.e.  user+critera@example.com).  We use that a *lot* to make it easy to route incoming mail to specific folders in Sieve.  In the API it just silently fails to add the member.  In the web admin interface it strips the '+criteria' part and just adds 'user@example.com'.  Is there a way we can allow this?

3

Re: API alias bug?

dgood wrote:

I discovered by accident that I can use "PUT" on /api/alias/<alias> even if the alias doesn't exist.

Confirmed it's a bug of iRedAdmin-Pro, and fixed in development edition moment ago. Thank you very much for the feedback.

dgood wrote:

One additional issue with aliases -- I can't have a member of an alias use a '+' in the local part (i.e.  user+critera@example.com).  We use that a *lot* to make it easy to route incoming mail to specific folders in Sieve.  In the API it just silently fails to add the member.  In the web admin interface it strips the '+criteria' part and just adds 'user@example.com'.  Is there a way we can allow this?

Fixed also.