how to call http api in roundcube mail client to change password?

Question:

I wish to call http api to change password in roundcube mail client using python code. How can this be done? Where is the exact location in the roundcube configuration and how is it invoked?

Asked By: user956424

||

Answers:

  1. Ensure the httpapi is available in your install

  2. In the main roundcube configuration file config.inc.php set the variables:
    $config[‘password_httpapi_url’] =

    ‘http://host:5000/change_user_password’; // required
    $config[‘password_httpapi_method’] = ‘GET’; // default
    $config[‘password_httpapi_var_user’] = ‘username’; // optional
    $config[‘password_httpapi_var_curpass’] = ‘curpass’; // optional
    $config[‘password_httpapi_var_newpass’] = ‘newpass’; // optional

Important NOTE: If you use the GET method you can pass the variables as parameters using query string values eg. the request.args.get(‘username’)

If you use the POST method you need to use the form fields. eg. request.form[‘username’]

  1. Pass the http api driver name in plugins/password/config.inc.php:
    $config[‘password_driver’] = ‘httpapi’;

  2. Reload the web server.

Answered By: user956424
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.