Our dovecot server and mail server authenticate users using the SHA1 digest. We cannot change the current digest because we have so many users and we do not want them to recreate all their passwords.
We need an easier way to create a digest for entering into the database for our users (and, ultimately, create a web interface so that they can change it themselves).
We are currently creating a digest using the linux command:
dovecotpw -s SHA1
We want to switch because dovecotpw is not scriptable (at least not without using the expected or something similar). However, everything I tried (sha1sum, mysql sha1, python hashlib.sha1), everything produces something very different from the dovecotpw command.
Below is the output of various commands for the word: password
dovecotpw -> W6ph5Mm5Pz8GgiULbPgzG37mj9g= sha1sum -> 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 python hashlib.sha1() -> 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 mysql sha1() -> 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
So, dovecot seems to be the one who does things differently. Unfortunately, this is the one I need to create.
Any idea how I can get dovecot sha1 from a script command?
Thanks.
mhost source share