A lightweight HTTP service that provides email address validation, sanitization, and disposable email detection.
- Email validation using regex pattern
- Email sanitization (lowercase, whitespace removal, plus addressing removal)
- Disposable email domain detection
- Simple REST API interface
- Go 1.x or higher
- A disposable email blocklist file (provided as
disposable_email_blocklist.conf
)
git clone https://github.com/eser/sanitizer-svc.git
cd sanitizer-svc
go build
- Start the server:
./sanitizer-svc
The server will start on port 8080.
Validates, sanitizes, and checks if an email address is from a disposable domain.
Query Parameters:
email
(required): The email address to process
Response:
{
"isValid": true,
"sanitized": "[email protected]",
"isDisposable": false
}
Example Usage:
curl "http://localhost:8080/[email protected]"
The service applies the following sanitization rules:
- Converts email to lowercase
- Removes whitespace
- Removes plus addressing (e.g.,
[email protected]
→[email protected]
) - Removes dots from the local part (e.g.,
[email protected]
→[email protected]
)
Apache 2.0
Thanks to disposable-email-domains project for providing the blocklist and making it available under Public Domain.
Contributions are welcome! Please feel free to submit a Pull Request.