[Mailman-Users] Setting max_message_size for selected list viawithlist

Mark Sapiro msapiro at value.net
Thu May 19 02:06:43 CEST 2005


Christopher Adams wrote:

>I would like to change the max_message_size for a group of lists. I plan to use withlist to do this. 
>I have the withlist command below and can do it with all lists or 1 list but am unsure how to do it 
>with a group of lists, whose names are currently in a text file. I probably could do it using a 
>shell script or something, but I am guessing that withlist probably accepts files for input, but how?


There is no option for withlist to directly process other than a single
list or all lists. To run a script via withlist on a subset of lists
contained in a file, you could use a shell script or modify your
withlist script along the lines of the following (off the top of my
head, really quick - no testing, no warranty)


###maxmessagesize.py
### determines maximum message size allowed to select lists
### useage: withlist -l -r maxmessagesize
def maxmessagesize(m):
#
# open and read the list names file
   f = open('path to your file of names')
   l = f.read()
#
# is this list's name in the file
   if l.find(m._internal_name) >= 0:
      m.max_message_size = 500
      m.Save()
      m.Unlock()
   f.close()

One potential problem is it will process a list you don't want whose
name is a substring of the name of a list you do want.

--
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list