[Mailman-Users] Regexp for blocking addresses

Chris Nulk cnulk at scu.edu
Mon Sep 28 19:22:55 CEST 2015


On 9/25/2015 9:16 PM, Mark Sapiro wrote:
> On 09/25/2015 09:01 PM, Mark Sapiro wrote:
>> Here's another idea.
>>
>> Find the following in /path/to/mailman/Mailman/MailList.py
>>
>>      def GetBannedPattern(self, email):
>>          """Returns matched entry in ban_list if email matches.
>>          Otherwise returns None.
>>          """
>>          return self.GetPattern(email, self.ban_list)
>>
>> and change it to
>>
>> bad_users = ['joeblow at gmailcom',
>>               'johndoe at gmailcom',
>>               'jackblack at gmailcom',
>>               ...                       (the rest of the addrs to ban)
>>              ]
> ...
>
>
> Ooops. In the above addition, the bad_users line needs to be indented 4
> spaces to line up with the following '    def ...'.
>

Would it make sense to define the "bad users" in mm_cfg.py?  That way it 
would be a bit easier to add/remove/change addresses when needed.  Also, 
wouldn't updating Mailman replace the modified 
/path/to/mailman/Mailman/MailList.py?

Just a thought,
Chris


More information about the Mailman-Users mailing list