[Mailman-Users] Writing a custom handler

Mark Sapiro mark at msapiro.net
Thu Jul 4 06:44:46 CEST 2013


On 07/03/2013 07:40 AM, Chris Nulk wrote:
> 
> On 7/2/2013 5:23 PM, Mark Sapiro wrote:
>> On 07/02/2013 03:09 PM, Chris Nulk wrote:

>>
>> Not necessary to lowercase sender here as msg.get_senders() always
>> returns lowercased addresses unless called with a preserve_case argument
>> with a True value.
> 
> Thanks.  It was more of a just to make sure thing.


OK.


> Actually, I code I was referring to was in Read_GlobalBan_File:


Yes, I understood that. I didn't comment on the change to
Read_GlobalBan_File as I had no comment.


> 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.

-- 
Mark Sapiro <mark at msapiro.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