Open
Conversation
adding modoboa api v2 support.
might figure out how to get helpful info back to the user:
I needed to get these from modoboa error logs to help a user:
`400 Bad Request` response:
{"new_password":["Password must contain at least 1 uppercase letter."]}
`400 Bad Request` response:
{"new_password":["The password is too similar to the username."]}
compat with modoboa api v2.
still need better error feedback to user.
["The password is too similar to the username."]}
{"new_password":["Password must contain at least 1 uppercase letter."]}
{"new_password":["Password must contain at least 1 digit."]}
etc currently need to be seend in the modoboa error.log to give user feedback when failed attempt.
…but probably need to register it somewhere so just leaving with original modoboa.php name.
alecpl
reviewed
Sep 27, 2025
requires modoboa v2 api. https://github.com/modoboa/modoboa/releases/tag/2.0.0
alecpl
requested changes
Oct 5, 2025
| $token = $rcmail->config->get('password_modoboa_api_token'); | ||
| $IMAPhost = $_SESSION['imap_host']; | ||
| // uncomment and add your url if you use a differente url for your modoboa instance and api: | ||
| //$IMAPhost = 'mymodoboa.somewhere.net'; |
Member
There was a problem hiding this comment.
Please, remove this comment or introduce a new config option.
|
|
||
| // Decode json string | ||
| $decoded = json_decode($response); | ||
| $decoded = json_decode($responseBody); |
| return PASSWORD_CONNECT_ERROR; | ||
| } | ||
| } | ||
| ?> |
Member
|
I'm not sure if it isn't too early to remove Modoboa v1 support. v2 exists for 3 years only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
modoboa api v2 needs old password and new password.