Ah. So when I thought I set the list pw, I didn't understand how "mailman shell" worked. Now I find that I cannot actually set it (see appended stack trace). However I found this thread:
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/Q...
and was able to use curl to set the list pw using something like:
curl --user restadmin:restpass -X PATCH --data \
'moderator_password=????????????' \
http://localhost:8001/3.1/lists/test.example.com/config
With that in place, posting with the correct approved header works for "mailman inject" and SMTP. And in both cases, the modified footer template was used. Also, members and non-members get the (custom) bounce message when they attempt to post.
The help and patience are appreciated.
Craig
mm 299 % mailman shell Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
from zope.component import getUtility from mailman.interfaces.listmanager import IListManager listspec = 'test.example.com' mlist = getUtility(IListManager).get(listspec) pw = '????????????' mlist.moderator_password = config.password_context.encrypt(pw) commit() Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1815, in _execute_context context = constructor( ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 1494, in _init_compiled l_param: List[Any] = [ ^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 1496, in <listcomp> flattened_processorskey File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/sqltypes.py", line 918, in process return DBAPIBinary(value) ^^^^^^^^^^^^^^^^^^ TypeError: memoryview: a bytes-like object is required, not 'str' The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python3.11/site-packages/mailman/database/base.py", line 54, in commit self.store.commit() File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2030, in commit trans.commit(_to_root=True) File "<string>", line 2, in commit File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1311, in commit self._prepare_impl() File "<string>", line 2, in _prepare_impl File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1286, in _prepare_impl self.session.flush() File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4331, in flush self._flush(objects) File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4466, in _flush with util.safe_reraise(): File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 121, in __exit__ raise exc_value.with_traceback(exc_tb) File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4427, in _flush flush_context.execute() File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute rec.execute(self) File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 642, in execute util.preloaded.orm_persistence.save_obj( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 85, in save_obj _emit_update_statements( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 912, in _emit_update_statements c = connection.execute( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1419, in execute return meth( ^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1821, in _execute_context self._handle_dbapi_exception( File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1815, in _execute_context context = constructor( ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 1494, in _init_compiled l_param: List[Any] = [ ^ File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 1496, in <listcomp> flattened_processorskey File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/sqltypes.py", line 918, in process return DBAPIBinary(value) ^^^^^^^^^^^^^^^^^^ sqlalchemy.exc.StatementError: (builtins.TypeError) memoryview: a bytes-like object is required, not 'str' [SQL: UPDATE mailinglist SET moderator_password=? WHERE mailinglist.id = ?] [parameters: [{'moderator_password': '$0$aaaaaa=000000$a0aA00aaAaAaaAaa$AaAA0.aAAaAA0AAAAaaAAaaAaAAA0aA0Aa0A00aA0AAaAa0A0aAaaaA0AAAaAa0Aaaaaaaaaa0aaAAaaAa0Aa/', 'mailinglist_id': 1}]]