From b7476d1c86053181cb38aa3acd3fc718fde55979 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 10 Jun 2019 17:29:24 +0200 Subject: implement a simple CAPTCHA scheme based on questions and answers configured by the site admin --- Mailman/Defaults.py.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Mailman/Defaults.py.in') diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 3350f278..6f645953 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -131,6 +131,22 @@ SUBSCRIBE_FORM_SECRET = None # test. SUBSCRIBE_FORM_MIN_TIME = seconds(5) +# Use a custom question-answer CAPTCHA to protect against subscription spam. +# Has no effect unless SUBSCRIBE_FORM_SECRET is set. +# Should be set to a dict mapping language keys to a list of pairs +# of questions and regexes for the answers, e.g. +# CAPTCHAS = { +# 'en': [ +# ('What is two times six?', '(12|twelve)'), +# ], +# 'de': [ +# ('Was ist 3 mal 6?', '(18|achtzehn)'), +# ], +# } +# The regular expression must match the full string, i.e., it is implicitly +# acting as if it had "^" in the beginning and "$" at the end. +CAPTCHAS = None + # Use Google reCAPTCHA to protect the subscription form from spam bots. The # following must be set to a pair of keys issued by the reCAPTCHA service at # https://www.google.com/recaptcha/admin -- cgit v1.2.3 From 496e59f4cc7b4db11a26bfc6ad70bc395f1ffce6 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 10 Jun 2019 22:05:32 +0200 Subject: Mention in the docs that 'en' is used as the default key --- Mailman/Defaults.py.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Mailman/Defaults.py.in') diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 6f645953..401dadc3 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -138,6 +138,7 @@ SUBSCRIBE_FORM_MIN_TIME = seconds(5) # CAPTCHAS = { # 'en': [ # ('What is two times six?', '(12|twelve)'), +# ('What is this mailing list software called?', '[Mm]ailman'), # ], # 'de': [ # ('Was ist 3 mal 6?', '(18|achtzehn)'), @@ -145,6 +146,8 @@ SUBSCRIBE_FORM_MIN_TIME = seconds(5) # } # The regular expression must match the full string, i.e., it is implicitly # acting as if it had "^" in the beginning and "$" at the end. +# An 'en' key must be present and is used as fall-back if there are no questions +# for the currently set language. CAPTCHAS = None # Use Google reCAPTCHA to protect the subscription form from spam bots. The -- cgit v1.2.3