// website builders and cms
Via APIJoomla email verification with pingutil
Joomla sites that allow user registration attract scripted signups on temp-mail domains and gibberish addresses, and every one of them lands in the Users list and the activation mail queue. A small user plugin subscribed to onUserBeforeSave can send new addresses to pingutil and throw an exception to stop the save, the same way the core Terms plugin blocks a registration. If pingutil does not answer within 3 seconds, the plugin steps aside and the account is created.
Where it connects: User plugin on the onUserBeforeSave event (Joomla\CMS\Event\User\BeforeSaveEvent), Joomla 5
What goes wrong without it
- We get dozens of new users a day with addresses like kx7qpz2m@ and none of them ever activate.
- Activation emails to throwaway inboxes bounce, and our host keeps asking about the bounce rate on the shared mail server.
- Captcha helped for a while, then the registrations came back with different temp-mail domains each week.
What you can do with Joomla and pingutil
Block disposable and machine-generated addresses at com_users registration
For new front-end accounts, call /v1/lookup with skip_enrichment: true and throw when verdict.is_spam is true. com_users shows the message on the registration form and no user row is written.
Let administrators create any account
Check isClient('administrator') and return early, so staff adding users in the backend are never blocked by the check.
Spot role addresses without blocking them
verdict.low_trust marks info@ and noreply@ style addresses. Let them register and handle them in onUserAfterSave, for example by adding them to a review user group.
Set it up
- 1
Create an API key in the pingutil dashboard.
- 2
Build a user plugin (folder plugins/user/pingutil) with an XML manifest that declares the namespace, a services/provider.php that registers the plugin class, and the extension class below in src/Extension/Pingutil.php. Add a password-type api_key field to the manifest config.
- 3
Install it from System → Install → Extensions, then enable it under System → Manage → Plugins and paste the key into its settings.
- 4
Register on the front end with test@mailinator.com to confirm the error shows, then with your own address to confirm it passes.
- 5
Keep the 3-second timeout: the check runs inside the registration request, so a slow answer is a slow form.
<?php
namespace Acme\Plugin\User\Pingutil\Extension;
\defined('_JEXEC') or die;
use Joomla\CMS\Event\User\BeforeSaveEvent;
use Joomla\CMS\Http\HttpFactory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Event\SubscriberInterface;
final class Pingutil extends CMSPlugin implements SubscriberInterface
{
public static function getSubscribedEvents(): array
{
return ['onUserBeforeSave' => 'onUserBeforeSave'];
}
public function onUserBeforeSave(BeforeSaveEvent $event): void
{
// New accounts from the site only; edits and backend users pass.
if (!$event->getIsNew() || $this->getApplication()->isClient('administrator')) {
return;
}
$email = trim((string) ($event->getData()['email'] ?? ''));
$key = (string) $this->params->get('api_key', '');
if ($email === '' || $key === '') {
return;
}
try {
$response = HttpFactory::getHttp()->post(
'https://pingutil.com/v1/lookup',
json_encode(['input' => $email, 'skip_enrichment' => true]),
['Authorization' => 'Bearer ' . $key, 'Content-Type' => 'application/json'],
3
);
} catch (\RuntimeException $e) {
return; // Timeout or connection error: fail open.
}
if ($response->getStatusCode() !== 200) {
return; // 429 quota_exceeded, rate_limited or 5xx: fail open.
}
$data = json_decode((string) $response->getBody(), true);
if (!empty($data['verdict']['is_spam'])) {
// Same pattern as the core Terms plugin: the exception stops the save.
throw new \InvalidArgumentException('Please register with a permanent email address.');
}
}
}What to do with each result
| pingutil result | Action in Joomla |
|---|---|
| verdict.is_spam: true (disposable_domain, randomized_local_part) | Throw from onUserBeforeSave; com_users shows the message and the user is not saved. |
| verdict.low_trust: true (role_based, system_generated) | Allow the save; add the user to a review group in onUserAfterSave. |
| category: "company" | Optionally assign a business user group after save. |
| Timeout, 429 or 5xx | Return without throwing so the registration completes. |
Limits to plan for
- Fast mode classifies the address without an SMTP check, so a real-looking address on a working domain with a dead mailbox still registers. Call /v1/verify from a scheduled task later if you need mailbox-level results.
- BeforeSaveEvent and getIsNew() are the Joomla 5 event API. On Joomla 4 the event arrives as a generic event with positional arguments, so adapt the method before installing there.
- onUserBeforeSave fires for every user save, including saves from other extensions and community components, which is why the plugin checks isNew and the client before calling pingutil.
Joomla documentation
- manual.joomla.org/docs/building-extensions/plugins/plugin-events/user-auth/
- manual.joomla.org/docs/building-extensions/plugins/
Joomla is a trademark of its owner. This integration uses Joomla's documented extension points; it is not an official Joomla app.
Common questions
- Should the plugin throw or call $event->addResult(false)?
- The Joomla manual says you can abort with addResult(false) as long as you also give the user a message, by enqueueMessage or by raising an exception. Throwing does both at once, and it is what the core Terms plugin does on the registration form.
- Where should the API key live?
- In the plugin parameters as a password field, so it stays server-side and can be rotated from the backend. Never put it in a template or a JavaScript file.
Stop bad addresses in Joomla today
Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your Joomla setup will receive.