[Mailman-Users] Change user settings through command line

Jim Tittsler jwt at onjapan.net
Fri May 7 04:56:46 CEST 2004

On May 6, 2004, at 17:25, Geoff Powell wrote:

> Is it possible with Mailman 2.1.4-1 to change user settings from a
> command line tool? For example set nomail to 1 for a user on a mailing
> list? I looked in the bin directory and none of the utilities appear to
> be designed to do this, does anyone have any suggestions?

You can do this sort of thing with 'withlist'.

$ bin/withlist -l -i mylist
m.setDeliveryStatus('user at domain.com', MailList.MemberAdaptor.BYADMIN)

If this is the sort of thing you are going to do often, you should 
create a little Python script to remember the messy bits and save some 
typing.  You could create  a file called nomail.py containing:

from Mailman.Errors import NotAMemberError
from Mailman.MemberAdaptor import BYADMIN

def nomail(m, addr):
         m.setDeliveryStatus(addr, BYADMIN)
     except NotAMemberError:
         print 'No address matched:', addr

Then to disable someone, do (either explicitly or with a script or 

$ bin/withlist -l -r nomail mylist user at domain.com

Jim Tittsler             http://www.OnJapan.net/      GPG: 0x01159DB6
Python Starship          http://Starship.Python.net/
Ringo MUG Tokyo          http://www.ringo.net/rss.html

More information about the Mailman-Users mailing list