1 (edited by daavem 2012-05-03 06:33:25)

Topic: Remotely create a new user

Not sure if this is "as such" a support issue.

I'm wanting to create a service from where I'm running iRedMail on a standalone box, I want to make a request from a PHP script to the server to create a new email address, most likely via curl.

Is there a way to do this?

I can't find the code which creates the accounts in the current script so I'm at a lose.

Thanks,

----

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

2

Re: Remotely create a new user

Sorry, iRedAdmin doesn't provide this API.

Since iRedMail ships scripts (iRedMail-x.y.z/tools/create_mail_user_*) used to create mail accounts, you can easily create one to achieve your goal.

But here's another solution with iRedAdmin (or iRedAdmin-Pro):

*) Login with curl.

- Login page is usually: httpS://your_server/iredadmin/login
- Simply POST (http method) username, password to login page, and save the session cookie (with option '-c' or '--cookie-jar').

*) Access proper url to create new user.

To create new user under domain 'example.com':

- Access url: httpS://your_server/iredadmin/create/user/example.com
- Please view the html source file of  this page in web browser, find the necessary form data you should POST.

Note: There's a csrf token in the forum, you must copy the csrf_token and POST it.