Download the PHP package mjk-limon/temporary-email-checker without Composer
On this page you can find all versions of the php package mjk-limon/temporary-email-checker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mjk-limon/temporary-email-checker
More information about mjk-limon/temporary-email-checker
Files in mjk-limon/temporary-email-checker
Package temporary-email-checker
Short Description A simple temporary email checker for php
License MIT
Informations about the package temporary-email-checker
Temporary (Spam) Email Checker
A PHP service that validates email domains against whitelist and blacklist, with automatic disposable domain detection using our known database and UserCheck API.
Features
- ✅ Whitelist Checking - Quick validation against legitimate domains
- ✅ Blacklist Checking - Prevents known disposable/spam domains
- ✅ API Integration - Automatic disposable domain detection via UserCheck API
- ✅ Smart Caching - Automatically maintained whitelist and blacklist
- ✅ File-Based Storage - No database required, simple file management
- ✅ Indexed Cache - Ultra-fast lookups using indexed cache files by domain prefix
Cache System
The system uses indexed cache files for ultra-fast domain lookups:
How It Works
- Master files (
data/white.list,data/black.list) contain your source data and remain unchanged - Cache files (
.cache/whitelist-*.list,.cache/blacklist-*.list) are used for runtime lookups - Indexing by prefix - Domains are stored in separate files based on their first character:
whitelist-a.list→ domains starting with 'a'whitelist-b.list→ domains starting with 'b'- ... continue for all 26 letters
whitelist-others.list→ domains starting with numbers 0-9
Benefits
- ✅ Faster lookups - Search only in relevant cache file
- ✅ Original data safe - Master files never modified
- ✅ Easy management - New domains appended only to cache
- ✅ Minimal memory - Load only relevant portions
Initial Setup
Before first use, build the cache from your master data files:
This command:
- Reads
data/white.listanddata/black.list - Creates indexed cache files in
.cache/folder - Removes duplicates and sorts domains
- Displays statistics
Sample output:
Verify Cache
Check cache integrity anytime:
Rebuild Cache
When you manually update data/white.list or data/black.list, rebuild the cache:
How New Domains Are Stored
When a new domain is validated via the API:
- It's appended to the cache file (not the master file)
- Organized by its first character automatically
- Master
data/white.listanddata/black.listremain unchanged -
Next
configure.phprun will consolidate cache back to master files if needed - PHP 7.4+
- file_get_contents with stream context support
- Write permissions for list files
Installation
-
Clone or download the files to your web directory:
-
Set permission to .cache directory:
-
Add your master domain lists to
data/: -
Build the cache (IMPORTANT!):
-
Set proper permissions:
- Update the API key in
index.php:
Configuration
API Key
Get your UserCheck API key from usercheck.com and add it to index.php:
Cache Directory
Cache files are stored in .cache/ folder. Ensure it's writable:
Master Data Files
Keep your master lists in data/ folder:
API Usage
Check Email Domain
Request:
Workflow
The service follows this logic:
- Extract Domain - Gets domain from email address
- Check Whitelist Cache - Returns
trueif found inwhitelist-*.listcache - Check Blacklist Cache - Returns
falseif found inblacklist-*.listcache - API Check - Calls UserCheck API to detect disposable domains:
- If disposable → Appends to
blacklist-*.listcache → Returnsfalse - If legitimate → Appends to
whitelist-*.listcache → Returnstrue
- If disposable → Appends to
Important: Master files (data/white.list, data/black.list) are never modified. New domains are only added to cache files.
List File Format
Both white.list and black.list are plain text files with one domain per line:
Initial Whitelist
Blacklist Examples
Error Handling
The service throws exceptions for:
- Invalid email format
- API call failures
- Blacklisted domains
Handle exceptions in your integration:
UserCheck API
The service integrates with UserCheck API to verify disposable domains.
API Endpoint: https://api.usercheck.com/domain/{domain}
Headers: Authorization: Bearer {api_key}
Response:
License
MIT License - Feel free to use and modify