Barry Finkel wrote: >I have a question about the ban_list regex. In a reply on >Tue, 24 Apr 2007 07:59:28 Mark Sapiro wrote > >> So set Privacy options...->Sender filters->generic_nonmember_action >> to Accept so anyone can post and set Privacy options...->Subscription >> rules->ban_list to a regex that matches all addresses not in your >> domain. E.g., >> >> ^.*@(?!example\.com)$ >> >> or if you want to allow sub-domains within your domain >> >> ^.*@(.*\.)?(?!example\.com)$ > >If I want subdomains of example.com and anl.gov to be able to >subscribe (and to ban other domains), is this the correct regex for >ban_list? > > ^(regex|regex) > >i.e., > > ^(.*@(.*\.)?(?!example\.com)$|.*@(.*\.)?(?!anl\.gov)$)
No. The first problem is that my original regexps are wrong. I thought I had tested them, but apparently I hadn't. The simple domain without subdomains regexp should be ^.*@(?!example\.com$) The domain with subdomains regexp should be ^.*@(?!(.*\.)?example\.com$) That said, the ORing of these regexps as in ^(.*@(?!(.*\.)?example\.com$)|.*@(?!(.*\.)?example\.com$)) or even ^.*@((?!(.*\.)?example\.com$)|(?!(.*\.)?anl\.gov$)) will always match because these match addresses that don't end with something and if you OR together two different somethings, every address doesn't end with at least one of them so every address matches. You would need something like ^.*@(?!(.*\.)?(example\.com|anl\.gov)$) (and I did test that this time) -- Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://wiki.list.org/x/QIA9