Password plugin and Virtualmin not working as expected
|Reported by:||mfierro||Owned by:|
Description (last modified by alec)
I believe that the Password plugin is not working as expected with Virtualmin (at least it did not for me).
In particular, it seems that it would almost always compute the wrong domain parameter to be passed to the command line.
- Virtualmin hosting domain mydomain.com
- Usernames are in the form username.mydomain
The plugin retrieves the domain from the username (in my case the second token after the dot, as per configuration options) and executes the following command
chgvirtualminpasswd modify-user --domain mydomain --user username.mydomain
The correct command should be
chgvirtualminpasswd modify-user --domain mydomain.com --user username.mydomain
I solved the problem by retrieving the domain name from the IMAP host, i.e. in file drivers/virtualmin.php
$domain = $_SESSION['imap_host'];
This should work for any username configuration, and not just the one I am using.