[Mailman-Users] Writing a custom handler

Chris Nulk cnulk at scu.edu
Mon Jul 15 17:16:40 CEST 2013


On 7/3/2013 9:44 PM, Mark Sapiro wrote:
> On 07/03/2013 07:40 AM, Chris Nulk wrote:
>> Okay.  Makes sense.  Here is the modified do_discard_globalban code:
>>
>> def do_discard_globalban(mlist, msg, sender):
>>      # forward discarded message to site administrator(s) if defined
>>      #    in mm_cfg.GLOBALBANLIST_NOTIFY
>>      notifylist = []
>>      if mm_cfg.GLOBALBANLIST_NOTIFY:
>>          notifylist.append(mm_cfg.GLOBALBANLIST_NOTIFY)
>
> You might consider making mm_cfg.GLOBALBANLIST_NOTIFY a list of 1 or
> more addresses in which case the above would be
>
>      if mm_cfg.GLOBALBANLIST_NOTIFY:
>          notifylist.extend(mm_cfg.GLOBALBANLIST_NOTIFY)
>
> or you could get fancy and test if it's a list or a string and extend or
> append accordingly.
>

Sorry about not responding earlier, I was on vacation.  That is exactly 
what I intended.  I didn't see extend when I was looking up information 
on lists.  Thanks.

I was thinking about what you mentioned in an earlier message about this 
handler not catching the command requests like subscribe, unsubscribe, 
etc.  I think I have a possible solution but I want to think about it 
some more then ask about it.

Thanks for the help on the handler,
Chris


More information about the Mailman-Users mailing list