Hi All,
Using the Mailman shell, can the delivery mode of Digests be changed to 'Plain text' for all users on just one list ?
If it is, could someone tell me how that's done.
Thanks, iMark
iMark writes:
Using the Mailman shell, can the delivery mode of Digests be changed to 'Plain text' for all users on just one list ?
Do you want users who are receiving regular delivery to be changed to plain text digest as well as those who are getting MIME digests?
If it is, could someone tell me how that's done.
Run mailman shell with the "-l $LIST" argument ($LIST can be the posting address or the list ID), and then type the following (I'm omitting the shell prompt):
mailman.interfaces.member import DeliveryMode for member in m.subscribers: # If you want regular members switched to digest too, # OMIT the following line if member.delivery_mode != DeliveryMode.regular: member.delivery_mode = DeliveryMode.plaintext_digests
and when that loop finishes, use Ctrl-D to exit, which automatically persists the changes in the database. (If you really mess up -- very unlikely -- you can use "abort()" at the mailman shell top level prompt to abort the database transaction and start over.)
If you think you may want to do this for several lists, "mailman shell --details" will explain how to write a file 'set_digest' that you can place in Mailman's bin directory so you can use "mailman withlist -l $LIST -r set_digest" on each such LIST.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Le 2026-08-03 11:19, Stephen J. Turnbull a écrit :
Do you want users who are receiving regular delivery to be changed to plain text digest as well as those who are getting MIME digests?
I want to change the Delivery Mode (to Plain text digests) only for the users who are currently getting MIME digests. The users with "Regular delivery" stay that way.
=================
Run mailman shell with the "-l $LIST" argument ($LIST can be the posting address or the list ID), and then type the following (I'm omitting the shell prompt):
mailman.interfaces.member import DeliveryMode for member in m.subscribers: # If you want regular members switched to digest too, # OMIT the following line if member.delivery_mode != DeliveryMode.regular: member.delivery_mode = DeliveryMode.plaintext_digests
What am I missing here ? I'm getting this syntax error message (with the carats underneath "import") ...
(venv) ... $ mailman shell -l mylist@lists.mydomain.com 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. The variable 'm' is the mylist@lists.mydomain.com mailing list
mailman.interfaces.member import DeliveryMode for member in m.subscribers: File "<console>", line 1 mailman.interfaces.member import DeliveryMode for member in m.subscribers: ^^^^^^ SyntaxError: invalid syntax
On August 3, 2026 4:20:36 PM PDT, iMark <imark@posteo.net> wrote:
The variable 'm' is the mylist@lists.mydomain.com mailing list
mailman.interfaces.member import DeliveryMode for member in m.subscribers: File "<console>", line 1 mailman.interfaces.member import DeliveryMode for member in m.subscribers: ^^^^^^ SyntaxError: invalid syntax
It looks like your line breaks are not correct.
The line should be
from mailman.interfaces.member import DeliveryMode
And
for member in m.subscribers:
is a separate line. It appears the 'from' is missing and maybe a line break is missing.
Also, in mailman shell in interactive mode, the import line is not required at all as those things are all imported automatically, but in a script as Steve also suggested, the import is required.
-- Mark Sapiro <mark@msapiro.net> Sent from my Not_an_iThing with standards compliant, open source software.
Mark Sapiro writes:
It looks like your line breaks are not correct.
Indeed. "Modern" MUAs are often not useful for copy and pasting code.
It appears the 'from' is missing
That was me. Thanks for fixing!
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
participants (3)
-
iMark -
Mark Sapiro -
Stephen J. Turnbull