1 (edited by c33s 2017-01-19 12:53:07)

Topic: [Api] Cannot add alias to user & quota missing

============ Required information ====
- iRedMail version (check /etc/iredmail-release):  iRedMail-0.9.5-1
- Linux/BSD distribution name and version: debian8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? yes (2.4.1)
- Related log if you're reporting an issue:
====
when i make an api call to add an existing alias to a user i get a "None" in return and the alias is not mapped to the user.

i have done the following steps:

- created the domain
- deleted the user (for cleanup in automated script)
- created the user
- created the alias
- updated the user (tried with addAlias and aliases)

- domain: created (has quota)
- user: created (quota missing)
- alias: created
- alias not mapped to user (not in the checkbox section under the general tab nor in the textarea aliases tab)

do i missunderstand something?

i use the following script to create daomains, user and aliases:

https://gist.github.com/c33s/6f19715cec … 8a3a8e2471

nginx returns a 200

127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "POST /iredadmin/api/login HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "POST /iredadmin/api/domain/example.com HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "POST /iredadmin/api/alias/firstname@example.com HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "POST /iredadmin/api/alias/firstname.lastname@example.com HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "DELETE /iredadmin/api/user/lastname@example.com HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:32 +0100] "POST /iredadmin/api/user/lastname@example.com HTTP/1.1" 200 28 "-" "curl/7.38.0"
127.0.0.1 - - [19/Jan/2017:05:34:33 +0100] "PUT /iredadmin/api/user/lastname@example.com HTTP/1.1" 200 14 "-" "curl/7.38.0"

iredmail-pro py is "hit"

127.0.0.1 [pid: 7669|app: 0|req: 1/3] 10.0.2.2 () {60 vars in 1164 bytes} [Thu Jan 19 05:30:00 2017] POST /iredadmin/login => generated 0 bytes in 162 msecs (HTTP/1.1 303) 3 headers in 211 bytes (2 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 3/4] 10.0.2.2 () {56 vars in 1073 bytes} [Thu Jan 19 05:30:00 2017] GET /iredadmin/dashboard/checknew => generated 14198 bytes in 21022 msecs (HTTP/1.1 200) 2 headers in 146 bytes (2 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 4/5] 127.0.0.1 () {46 vars in 609 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/login => generated 17 bytes in 61 msecs (HTTP/1.1 200) 2 headers in 153 bytes (2 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 5/6] 127.0.0.1 () {48 vars in 716 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/domain/example.com => generated 17 bytes in 35 msecs (HTTP/1.1 200) 2 headers in 153 bytes (3 switches on core 0)
127.0.0.1 [pid: 7669|app: 0|req: 2/7] 127.0.0.1 () {48 vars in 716 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/domain/consistency.at => generated 17 bytes in 42 msecs (HTTP/1.1 200) 2 headers in 153 bytes (2 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 6/8] 127.0.0.1 () {44 vars in 614 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/alias/firstname@example.com => generated 17 bytes in 63 msecs (HTTP/1.1 200) 2 headers in 153 bytes (2 switches on core 0)
127.0.0.1 [pid: 7669|app: 0|req: 3/9] 127.0.0.1 () {44 vars in 628 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/alias/firstname.lastname@example.com => generated 17 bytes in 38 msecs (HTTP/1.1 200) 2 headers in 153 bytes (3 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 7/10] 127.0.0.1 () {44 vars in 614 bytes} [Thu Jan 19 05:34:32 2017] DELETE /iredadmin/api/user/lastname@example.com => generated 17 bytes in 102 msecs (HTTP/1.1 200) 2 headers in 153 bytes (3 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 8/11] 127.0.0.1 () {48 vars in 726 bytes} [Thu Jan 19 05:34:32 2017] POST /iredadmin/api/user/lastname@example.com => generated 17 bytes in 58 msecs (HTTP/1.1 200) 2 headers in 153 bytes (3 switches on core 0)
127.0.0.1 [pid: 7668|app: 0|req: 9/12] 127.0.0.1 () {48 vars in 725 bytes} [Thu Jan 19 05:34:32 2017] PUT /iredadmin/api/user/lastname@example.com => generated 4 bytes in 39 msecs (HTTP/1.1 200) 1 headers in 121 bytes (2 switches on core 0)

would be cool if the api auto creates the aliases if i provide them in the user create or in the user update.

ps. do you have a eta for the release of the new version iredadmin-pro? cant wait for the rest of the api

curl -X PUT -i -b cookie.txt -d "cn=John Smith&mailQuota=2048" https://<server>/api/user/<mail>

----

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

2

Re: [Api] Cannot add alias to user & quota missing

the quota for a user only works of i set it over the domain.

3

Re: [Api] Cannot add alias to user & quota missing

Does your test case work with our online demo? Try it please:
http://www.iredmail.org/admin_demo.html

c33s wrote:

- updated the user (tried with addAlias and aliases)

This API is not available in the latest iRedAdmin-Pro stable release (v2.4.1).

c33s wrote:

- domain: created (has quota)
- user: created (quota missing)

This is actually a bug of v2.4.1, and fixed in latest development edition.

We're going to release new iRedAdmin-Pro version NEXT WEEK.