My projects

Word rules, CSV and spam protection

Import rules, test matching and distinguish review signals from submission quotas.

Lesson 11 / 22 · Commentail 1.3.2

Start with a few rules an editor can explain. Under Comments → Rules add a phrase with the review action. Select Apply rules for the practice discussion; other moderation modes do not run this dictionary.

Check matching

Submit the phrase with different capitalization and punctuation between words. Matching uses complete word sequences rather than substrings inside another word; Russian ё and е are equivalent. Displayed text is unchanged. Reject takes precedence when both actions match.

Transfer rules with CSV

Export the existing list first. Export includes all rules regardless of filters. Create a UTF-8 file with these exact column names:

csv
phrase,action,enabled
unwanted promotion,review,1
blocked phrase,reject,1

Actions are review or reject; enabled accepts 1/0 and true/false. Commas or semicolons are supported as separators. Quote phrases containing separators using normal CSV escaping. Exports include a BOM for spreadsheet compatibility.

Import updates action and enabled state by exact phrase text, adds new phrases and retains unmentioned rules. It does not replace the entire dictionary. A duplicate or invalid row aborts the import; fix the reported row. Start with a small sample. Defaults are 5 MiB and 20,000 rows, configurable only under default.

Understand guest review signals

A hidden field, fast submissions, selected header signals, repeated long text and multiple links can trigger review. Defaults include repeated normalized text of at least 80 characters within an hour and at least three explicit links. A signal does not prove that a visitor is a bot.

Set technical values while retaining other options:

python
COMMENTAIL = {
    "default": {
        "GUEST_CAPTCHA_MODE": "adaptive",
        "AUTHOR_MIN_INTERVAL": 30,
        "AUTHOR_LIMIT_PER_HOUR": 20,
        "IP_LIMIT_PER_HOUR": 100,
        "GUEST_FORM_MIN_SECONDS": 2,
        "GUEST_LINK_REVIEW_THRESHOLD": 3,
    },
}

GUEST_FORM_MIN_SECONDS is a review threshold, not a forced wait before submission. Zero disables that signal. GUEST_CAPTCHA_MODE="always" changes CAPTCHA requirements, not email confirmation.

Author and IP quotas span all Pages of a Site. Office and mobile users may share a public IP. If everyone is throttled, check proxy configuration in lesson 19 before raising limits. Keep CSRF enabled. Template overrides must retain commentail_contact, form_age and the other hidden form controls.

Related lessons

Related documentation

Was this article useful?

Comments 0

Name: up to 40 characters.

After submitting, we will email you a link to confirm your email address.

Maximum 5000 characters.

No published comments yet.