Spam protection
Target group: Integrators
Both forms carry a honey pot field. Bots that load the form in a real browser and leave that field empty get past it; they are typically used for subscription bombing, where a victim's address is subscribed to as many newsletters as possible. For those, the extension can add an ALTCHA check and limit the number of submissions per IP address.
ALTCHA
ALTCHA is a self-hosted proof-of-work check. When a visitor starts filling in the form, the browser solves a small challenge in the background (about 0.1 seconds) and "I'm not a robot" is ticked automatically. There is no puzzle, no cookie and no external service: challenges are created and verified on your own server.
- Make sure the Composer package
altcha-is installed (it is a dependency of this extension; installations without Composer cannot use ALTCHA).org/ altcha - Set the constant
plugin..tx_ laposta. settings. altcha. enable = 1 - Run
vendor/(or the database compare in the Install Tool) to create the cache tablebin/ typo3 database: updateschema cache_.laposta_ altcha - Check that
/laposta/returns JSON and is not cached by a reverse proxy (the response carriesaltcha- challenge Cache-).Control: no- store - If your site package overrides
Subscribe.orhtml Unsubscribe., addhtml <f:inside the form, before the submit button, withinrender partial="Altcha" /> <f:. Without it the widget is missing and every submission is refused.if condition=" {settings. altcha. enable}">
With ALTCHA enabled, a submission without a valid, unused solution is refused with a notification, and logged when logging is enabled. Each solved challenge is accepted once.
The used challenges are kept in the cache laposta_. With more than one
web server, all servers must share that cache. The default database backend does;
to use another shared backend such as Redis, define
$GLOBALS
in your own configuration.
The widget follows the language of the page (<html lang>) and of the browser.
English is built in and the Dutch translation is included; other languages fall back
to English.
Settings in the extension configuration:
altchaCost - PBKDF2 iterations per attempt. Higher is harder for bots and slower for
visitors. Default
10000. altchaLifetime - Seconds a challenge stays valid after the widget fetched it. Default
1800.
Content Security Policy
The widget script (Resources/) adds its
styles inline and runs its calculations in blob: web workers. With a Content
Security Policy, allow style- and worker-.
Styling
The extension ships no styles of its own. The altcha- element is inline
without margins, so give it display: block and a bottom margin to keep it clear
of the submit button.
The widget declares its defaults as CSS custom properties on :root, for example
--, -- and --.
Set your own values on the altcha- element. For other properties, prefix
the selector with the element name (altcha-): the widget
injects its own styles after your stylesheet with single-class selectors.
Accessibility
There is no puzzle, so the check meets WCAG 2.2 success criterion 3.3.8 (Accessible
Authentication). The widget is operable with the keyboard and has a visible focus
indicator. Its checkbox is 22 by 22 pixels by default; set
-- to meet 2.5.8 (Target Size) on the checkbox itself.
Visitors without JavaScript see a notification that JavaScript is required.
Rate limit
The extension can limit how often each form is sent from one IP address. Only submissions that pass the honey pot and the ALTCHA check count; the subscribe and unsubscribe forms have separate counters. A submission over the limit is refused with a notification before the Laposta API is called, and logged when logging is enabled.
The limit is off by default. Set it in the extension configuration:
rateLimit - Maximum submissions per form from one IP address within the interval.
0disables the limit. Default0. rateLimit Interval - A relative time such as
1 houror30 minutes. Default1 hour.
Many visitors can share one IP address, for example in an office, a school or on a
mobile network, so do not set the limit too low. The counters are kept in the TYPO3
core cache ratelimiter. Behind a reverse proxy, configure
$GLOBALS so the visitor's address is
used instead of the proxy's.