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?
CodePudding user response:
Ensure the httpapi is available in your install
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']
Pass the http api driver name in plugins/password/config.inc.php: $config['password_driver'] = 'httpapi';
Reload the web server.