On 6/8/21 18:37, Mark Sapiro wrote:
On 8/6/21 9:18 AM, Guillermo Hernandez (Oldno7) via Mailman-users wrote:
Hi all:
I need to remove all non members from a list. I know I can do it via Postorius, but it has to be done one at a time. (you can delete ALL suscribers but not all non members...)
Anyone has a python recipe to do this?
$ /opt/mailman/mm/bin/mailman shell -l list.example.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 list.example.com mailing list
for nonmember in m.members.nonmembers: ... nonmember.unsubscribe() ... commit()
Thanks a lot for the promt response, Mark.
It's not functioning. It says:
"AttributeError: 'MemberRoster' object has no attribute 'nonmembers'"
My system info is:
Mailman Core Version GNU Mailman 3.3.3 (Tom Sawyer) Mailman Core API Version 3.1 Mailman Core Python Version 3.7.9 (default, Nov 6 2020, 21:14:59) [Clang 8.0.1 (tags/RELEASE_801/final 366581)]
Postorius 1.3.4