Mailman 3 Shell
Jump to navigation
Jump to search
Mailman 3 comes with a shell that allows to work directly on a list from Python's REPL. Use it wisely.
Troubleshooting
Step by step example: change the size of message attachments
- become the mailman
su mailman
- go to the venv home (important!)
cd we.lurk.org/venv
- start the shell with the list, the settings of which you want to edit:
mailman withlist mylist@we.lurk.org
- assign new value to max_message_size. Each unit is 1024 bytes, so 500K would be simply
m.max_message_size = 500
- quit the shell
exit() # or Ctrl-D
- Done! Enjoy your mailchimp forwards!
List all the subscribed emails from all lists
su mailman cd ~/env mailman shell >>> lm = getUtility(IListManager) >>> for mlist in lm.mailing_lists: ... for member in mlist.members.members: ... print(member.address.email, mlist.list_name) ... <lots of stuff>
Re-enable accounts that have been disabled for excess bounce
su mailman cd ~/env mailman shell -l listname@we.lurk.org >>> for member in m.members.members: ... if member.delivery_status == DeliveryStatus.by_bounces: ... member.preferences.delivery_status = DeliveryStatus.enabled ... print("Re-enabled delivery for bouncing member {} on list {}" ... .format(member.address.email, mlist.list_name)) ... <lots of stuff> >>> commit() >>> exit()