1

Topic: Adding Users from my own control panel

==== Required information ====
- iRedMail version: Latest
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 6.3
- Related log if you're reporting an issue:
====

I would like to be able to add users to my mail server from my own custom admin panel.

Is there an example of how I would add a user / email account?

I understand the iRedMail admin portal just manages the MySQL database.

How would I hash passwords to correspond with the current schema?

2

Re: Adding Users from my own control panel

mikeyg6754 wrote:

Is there an example of how I would add a user / email account?

Have a look into scripts in iRedMail installation package: iRedMail-0.8.4/tools/create_mail_user_*
You can also inspire yourself with mi conversion script from LDAP2SQL / it creates domains/accounts/aliases but no passwords (they are just copied as they share the LDAP format).

mikeyg6754 wrote:

I understand the iRedMail admin portal just manages the MySQL database.

I think so.

mikeyg6754 wrote:

How would I hash passwords to correspond with the current schema?

To the password format: supported auth methods are discussed in the same thread above, and also here. The format is the same as used in LDAP.

You can create valid password in PHP like this:

echo '{MD5}' . base64_encode(pack('H*', md5('secret')));
echo '{SHA}' . base64_encode(pack('H*', sha1('secret')));