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