Topic: Inconsistent REST API
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi,
(couldn't think of a better title, sorry)
I have developed a tool that uses the rest API to transfer all user domains/mail accounts/settings from one server to another. This is a much more elegant and 'correct' method vs just directly manipulating databases. However, I have run into some issues that make this not currently %100.
1) api/user/some.user@domain.com - will download a user profile, but will omit password hash and some other fields that are returned from the api call api/users/domain.com. It seems to me that 'user' should return the same exact data that 'users' does just for a single account as opposed to all under the domain.
2) The user password hash returned from api/users, is directly what is in the database. However, creating a user with POST api/user/some.user@domain.com, iredamin seems to be picky with what it will accept. My current server has users that migrated from other servers, and use several password hashes such as $1$blahblahblah, $6$blahblahblah, blahblahblah (crypt), and formal spec like '{SSHA512}0000....'. Dovecot itself understands these formats and more just fine. And so, iredadmin will allow you to READ these hashes, but if you try to WRITE some of them, you will get 'INVALID PASSWORD SCHEME'. I have been able to work around most of these in my tool by search/replace on the password strings so '$6$ becomes {SSHA512}, and $1$ becomes {MD5}, but I think it would be far better to simply allow an arbitrary string to be passed in and not return 'invalid password scheme'.
Mike-
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.