anto0102/mailguard

Flarum extension to sanitize and validate email registrations

Maintainers

Package info

github.com/anto0102/MailGuard

Type:flarum-extension

pkg:composer/anto0102/mailguard

Transparency log

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v2.0.7 2026-05-02 20:20 UTC

This package is auto-updated.

Last update: 2026-07-02 20:45:53 UTC


README

Flarum 2.0 Compatible License Total Downloads Latest Stable Version Monthly Downloads

MailGuard is a lightweight, ultra-optimized Flarum 2.0 extension to securely guard and validate email domains during user registration. Built entirely without external GUI frameworks to guarantee zero impact on server memory and provide instant, real-time blocking of unwanted users.

Features & Configuration Guide

Alias Anti-Fraud (Plus Strategy)

Gmail and many providers allow users to add a + (e.g., user+spam@gmail.com) to create "infinite" addresses for the same account.

  • Action: Block: Rejects any registration containing a + alias.
  • Action: Sanitize: Automatically removes the alias part (e.g., user+1@gmail.com becomes user@gmail.com) before saving.

Gmail Dot Strategy (Anti-Clone)

Gmail ignores dots (e.g., m.a.r.i.o@gmail.com is the same as mario@gmail.com). This is often used for account cloning.

  • Disabled (Standard): Dots are ignored by the filter; Flarum treats them as separate emails.
  • Check for Duplicates (Anti-Clone): [Recommended] The user can register with dots (maintaining their login UX), but MailGuard blocks the registration if the root version (without dots) already exists in the database.
  • Strict Block: Rejects any email containing dots in the local part for target providers.
  • Silent Clean: Automatically removes dots from the email before saving. Note: The user will then need to log in without dots.

DNS/MX Live Validation

Performs a real-time server check to verify if the domain has valid Mail Exchange (MX) records. Blocks fake domains like @nonexistent-provider.web instantly.

Domain Shield (Allow/Deny)

  • Allowlist: Only the listed domains can register. Perfect for corporate or invitation-only forums.
  • Denylist: All domains allowed except those listed (e.g., disposable email providers).

Installation & CLI

Install via Composer:

composer require anto0102/mailguard
php flarum cache:clear

Powerful CLI Commands:

# Audit users against current blocked domains
php flarum emailguard:audit

# Perform a deep audit and permanently remove non-compliant users
php flarum emailguard:audit --delete

# Export all current forum domains to CSV or JSON
php flarum emailguard:export --format=json

License

This project is licensed under the MIT License.

Support & Issues

If you experience any bugs, have questions, or want to suggest new features, please open an Issue directly on this GitHub repository.