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
Le 2026-08-04 03:14, Stephen J. Turnbull a écrit :
It looks like your line breaks are not correct.
It appears the 'from' is missing
Hi,
I'm not understanding this. After trying different ways (all reporting different "IndentationError") I got this far:
(venv) mailman@lon:/home/sysmin$ mailman shell -l mylist@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@mydomain.com mailing list
from mailman.interfaces.member import DeliveryMode for member in m.subscribers: ... member.delivery_mode = DeliveryMode.plaintext_digests ...
After the first ellipsis I entered a tab, then "member.delivery_mode = DeliveryMode.plaintext_digests"
Without the tab, I get the "IndentationError". With the tab, the line moves on to the next ellipsis.
What does the ellipsis signify ?
On 8/4/26 4:59 PM, iMark wrote:
(venv) mailman@lon:/home/sysmin$ mailman shell -l mylist@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@mydomain.com mailing list
from mailman.interfaces.member import DeliveryMode for member in m.subscribers: ... member.delivery_mode = DeliveryMode.plaintext_digests ...
After the first ellipsis I entered a tab, then "member.delivery_mode = DeliveryMode.plaintext_digests"
Without the tab, I get the "IndentationError". With the tab, the line moves on to the next ellipsis.
What does the ellipsis signify ?
In Python, block structure is defined by indentation which is critical.
In interactive mode, a >>> prompt indicates you are at the outer
level and a ... prompt indicates you are in a block.
There are a few issues with yours and with Steve's original. From the original,
for member in m.subscribers:
is wrong. It needs to be
for member in m.subscribers.members:
subscribers is a roster whose members are all members and nonmembers.
You may want that, although since nonmembers don't get mail it's
probably better to use the members roster which is only members and
not nonmembers.
Also, you left out
if member.delivery_mode != DeliveryMode.regular:
which skips members with regular delivery which you don't want to set to digest.
The complete interaction should look like
>>> for member in m.members.members:
... if member.delivery_mode != DeliveryMode.regular:
... member.delivery_mode = DeliveryMode.plaintext_digests
...
>>> commit()
The from mailman.interfaces.member import DeliveryMode is not needed n
mailman shell in interactive mode, although it wouldn't hurt.
Note the above indentation which is critical. I've used 4 and 8 spaces, but 1 and 2 tabs would also work.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 8/4/26 9:02 PM, Mark Sapiro wrote:
The complete interaction should look like
>>> for member in m.members.members: ... if member.delivery_mode != DeliveryMode.regular: ... member.delivery_mode = DeliveryMode.plaintext_digests ... >>> commit()
The above is badly formatted. It should be
>>> for member in m.members.members:
... if member.delivery_mode != DeliveryMode.regular:
... member.delivery_mode = DeliveryMode.plaintext_digests
...
>>> commit()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Le 2026-08-05 04:02, Mark Sapiro a écrit :
In Python, block structure is defined by indentation which is critical. In interactive mode, a
>>>prompt indicates you are at the outer level and a...prompt indicates you are in a block.
The complete interaction should look like
>>> for member in m.members.members: ... if member.delivery_mode != DeliveryMode.regular: ... member.delivery_mode = DeliveryMode.plaintext_digests ... >>> commit()
I got to the last line ( member.delivery_mode = DeliveryMode.plaintext_digests ) and entered it to then get the ellipsis (as you've shown).
What happens after that so I can get back to the outer level (>>>>) and commit ?
If I hit Enter, I get this error
... Traceback (most recent call last): File "<console>", line 3, in <module> AttributeError: property 'delivery_mode' of 'Member' object has no setter
And on repeating the procedure (and arriving at the final ellipse) if I enter CTL+D, it just jumps out of the shell (with no changes to the delivery modes).
On 8/4/26 9:34 PM, iMark wrote:
Le 2026-08-05 04:02, Mark Sapiro a écrit :
In Python, block structure is defined by indentation which is critical. In interactive mode, a
>>>prompt indicates you are at the outer level and a...prompt indicates you are in a block.The complete interaction should look like
>>> for member in m.members.members: ... if member.delivery_mode != DeliveryMode.regular: ... member.delivery_mode = DeliveryMode.plaintext_digests ... >>> commit()
Note the above has a formatting error. See my followup post correcting that.
I got to the last line ( member.delivery_mode = DeliveryMode.plaintext_digests ) and entered it to then get the ellipsis (as you've shown).
What happens after that so I can get back to the outer level (>>>>) and commit ?
If I hit Enter, I get this error
Enter is the appropriate thing. It then runs the block.
... Traceback (most recent call last): File "<console>", line 3, in <module> AttributeError: property 'delivery_mode' of 'Member' object has no setter And upon running the block it encounters the above error. Unfortunately when I tested this, I tested on a list with only regular members and didn't encounter the error.
The last line
member.delivery_mode = DeliveryMode.plaintext_digests
needs to be
member.preferences.delivery_mode = DeliveryMode.plaintext_digests
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Le 2026-08-05 04:52, Mark Sapiro a écrit :
The last line
member.delivery_mode = DeliveryMode.plaintext_digestsneeds to be
member.preferences.delivery_mode = DeliveryMode.plaintext_digests ` ``
Super! Thank you very much. Here is the working final (I hope the formatting gets preserved across mail clients).
How to change the Deliverymode for users in one list from MIME Digest to PlainText Digest
su mailman (venv)$ mailman shell -l mylist@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@mydomain.com mailing list
from mailman.interfaces.member import DeliveryMode for member in m.subscribers.members: ... if member.delivery_mode != DeliveryMode.regular: ... member.preferences.delivery_mode = DeliveryMode.plaintext_digests ... commit() exit()
NOTE TO SELF: Line 10 use 1 tab or 4 spaces after the first ellipse Line 11 use 2 tabs or 8 spaces after the second ellipse. Line 12 <ENTER>after the third and final ellipse
This is, sadly, correct. I miss the open web, but the finance-bros ruined it for everyone.
If you want, you can configure it so only the account creation page is protected by Anubis. This might be a happy medium... JavaScript is only required for the vulnerable step (which would also be the case with most captchas today).
--Jered
----- On Aug 5, 2026, at 12:52 AM, Mark Sapiro mark@msapiro.net wrote:
On 8/4/26 9:34 PM, iMark wrote:
Le 2026-08-05 04:02, Mark Sapiro a écrit :
In Python, block structure is defined by indentation which is critical. In interactive mode, a
>>>prompt indicates you are at the outer level and a...prompt indicates you are in a block.The complete interaction should look like
>>> for member in m.members.members: ... if member.delivery_mode != DeliveryMode.regular: ... member.delivery_mode = DeliveryMode.plaintext_digests ... >>> commit()Note the above has a formatting error. See my followup post correcting that.
I got to the last line ( member.delivery_mode = DeliveryMode.plaintext_digests ) and entered it to then get the ellipsis (as you've shown).
What happens after that so I can get back to the outer level (>>>>) and commit ?
If I hit Enter, I get this error
Enter is the appropriate thing. It then runs the block.
... Traceback (most recent call last): File "<console>", line 3, in <module> AttributeError: property 'delivery_mode' of 'Member' object has no setter And upon running the block it encounters the above error. Unfortunately when I tested this, I tested on a list with only regular members and didn't encounter the error.
The last line
member.delivery_mode = DeliveryMode.plaintext_digestsneeds to be
member.preferences.delivery_mode = DeliveryMode.plaintext_digests-- 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 jered@convivian.com
participants (4)
-
iMark -
Jered Floyd -
Mark Sapiro -
Stephen J. Turnbull