Error while Approving a Post Through Email
Hello,
I have installed mailman3 (with postgresql) on Ubuntu 22.04 in a virtual environment. I can approve/discard posts from the Web UI, but when trying to approve a post through email (Approved header as the first line in reply), the following error is showing up in mailman.log:
Dec 13 17:01:41 2022 (2677611) Uncaught runner exception: hash could not be identified Dec 13 17:01:41 2022 (2677611) Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/core/runner.py", line 179, in _one_iteration self._process_one_file(msg, msgdata) File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/core/runner.py", line 272, in _process_one_file keepqueued = self._dispose(mlist, msg, msgdata) File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/runners/command.py", line 214, in _dispose status = command.process( File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/commands/eml_confirm.py", line 67, in process return self.process_held( File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/commands/eml_confirm.py", line 104, in process_held approved = Approved().check(mlist, msg, msgdata) File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/rules/approved.py", line 143, in check is_valid, new_hash = config.password_context.verify(password, mpw) File "/opt/mailman/venv/lib/python3.10/site-packages/mailman/utilities/passwords.py", line 61, in verify return self._context.verify_and_update(password, hashed) File "/opt/mailman/venv/lib/python3.10/site-packages/passlib/context.py", line 2422, in verify_and_update record = self._get_or_identify_record(hash, scheme, category) File "/opt/mailman/venv/lib/python3.10/site-packages/passlib/context.py", line 2031, in _get_or_identify_record return self._identify_record(hash, category) File "/opt/mailman/venv/lib/python3.10/site-packages/passlib/context.py", line 1132, in identify_record raise exc.UnknownHashError("hash could not be identified") passlib.exc.UnknownHashError: hash could not be identified Dec 13 17:01:41 2022 (2677611) SHUNTING: 1670931101.6040337+d5806b00b2b9d03f25db396639f66f3a26516178
Any ideas?
Thanks Alex.
Alex A.J. writes:
line 1132, in identify_record raise exc.UnknownHashError("hash could not be identified") passlib.exc.UnknownHashError: hash could not be identified Dec 13 17:01:41 2022 (2677611) SHUNTING: 1670931101.6040337+d5806b00b2b9d03f25db396639f66f3a26516178
This looks like maybe you have the wrong password?
Maybe Mark or Abhilash has a more concrete suggestion, I've never used the Approved header with Mailman 3.
Steve
On 12/14/22 01:45, Stephen J. Turnbull wrote:
Alex A.J. writes:
line 1132, in identify_record raise exc.UnknownHashError("hash could not be identified") passlib.exc.UnknownHashError: hash could not be identified Dec 13 17:01:41 2022 (2677611) SHUNTING: 1670931101.6040337+d5806b00b2b9d03f25db396639f66f3a26516178
This looks like maybe you have the wrong password?
Maybe Mark or Abhilash has a more concrete suggestion, I've never used the Approved header with Mailman 3.
I don't have more time to look at this now, but I think it's a bug. This patch ``` --- a/src/mailman/rules/approved.py +++ b/src/mailman/rules/approved.py @@ -140,6 +140,7 @@ class Approved: mpw = mlist.moderator_password else: mpw = mlist.moderator_password.decode('utf-8') + mpw = config.password_context.encrypt(mpw) is_valid, new_hash = config.password_context.verify(password, mpw) if is_valid and new_hash: # Hash algorithm migration. ``` may fix it. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 12/14/22 09:41, Mark Sapiro wrote:
I don't have more time to look at this now, but I think it's a bug. This patch ``` --- a/src/mailman/rules/approved.py +++ b/src/mailman/rules/approved.py @@ -140,6 +140,7 @@ class Approved: mpw = mlist.moderator_password else: mpw = mlist.moderator_password.decode('utf-8') + mpw = config.password_context.encrypt(mpw) is_valid, new_hash = config.password_context.verify(password, mpw) if is_valid and new_hash: # Hash algorithm migration. ``` may fix it.
It is a bug, but that isn't the correct fix. The list's moderator_password attribute should already be encrypted. The bug is we don't catch the passlib.exc.UnknownHashError. It appears you either have not set the lists moderator_password or you have not set it to a properly encrypted value. Did you set it and if so, how? -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 12/14/22 15:40, Mark Sapiro wrote:
It is a bug, but that isn't the correct fix. The list's moderator_password attribute should already be encrypted. The bug is we don't catch the passlib.exc.UnknownHashError.
This is reported at https://gitlab.com/mailman/mailman/-/issues/1046 and fixed at https://gitlab.com/mailman/mailman/-/merge_requests/1072.
It appears you either have not set the lists moderator_password or you have not set it to a properly encrypted value. Did you set it and if so, how?
The above fix won't fix your underlying issue but will report that your confirmation failed for 'Invalid Approved: password'.
If you set the list's moderator_password via REST, it will be properly encrypted. If you set it via mailman shell, instead of
mlist.moderator_password = 'password'
you need
mlist.moderator_password = config.password_context.encrypt('password')
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi Mark, Thanks for the reply. Didn't set the moderator password for the list. I was using the same password used for logging in to the UI. Let me see if I can properly set it up as you mentioned. Thanks. Alex. On Thu, Dec 15, 2022 at 5:11 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/14/22 09:41, Mark Sapiro wrote:
I don't have more time to look at this now, but I think it's a bug. This patch ``` --- a/src/mailman/rules/approved.py +++ b/src/mailman/rules/approved.py @@ -140,6 +140,7 @@ class Approved: mpw = mlist.moderator_password else: mpw = mlist.moderator_password.decode('utf-8') + mpw = config.password_context.encrypt(mpw) is_valid, new_hash = config.password_context.verify(password, mpw) if is_valid and new_hash: # Hash algorithm migration. ``` may fix it.
It is a bug, but that isn't the correct fix. The list's moderator_password attribute should already be encrypted. The bug is we don't catch the passlib.exc.UnknownHashError.
It appears you either have not set the lists moderator_password or you have not set it to a properly encrypted value. Did you set it and if so, how?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________ Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to malayalamtex@gmail.com
participants (3)
-
Alex A.J.
-
Mark Sapiro
-
Stephen J. Turnbull