{"id":34910575,"url":"https://github.com/arraypress/email-blocklist","last_synced_at":"2026-01-20T16:25:47.640Z","repository":{"id":326905344,"uuid":"1105533069","full_name":"arraypress/email-blocklist","owner":"arraypress","description":"A simple, efficient library for checking email addresses against disposable email provider lists.","archived":false,"fork":false,"pushed_at":"2026-01-11T00:12:43.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T08:15:44.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arraypress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-27T18:54:04.000Z","updated_at":"2026-01-11T00:12:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/arraypress/email-blocklist","commit_stats":null,"previous_names":["arraypress/email-blocklist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/email-blocklist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Femail-blocklist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Femail-blocklist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Femail-blocklist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Femail-blocklist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/email-blocklist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Femail-blocklist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-26T11:08:18.077Z","updated_at":"2026-01-20T16:25:47.635Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Email Blocklist\n\nA simple, efficient library for checking email addresses against disposable email provider lists. Uses data from the [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains) project.\n\n## Installation\n\n```bash\ncomposer require arraypress/email-blocklist\n```\n\n## Usage\n\n### Quick Check\n\n```php\n// Using the helper function\nif ( is_disposable_email( 'user@tempmail.com' ) ) {\n    // Reject registration\n}\n```\n\n### Using the Class\n\n```php\nuse ArrayPress\\EmailBlocklist\\Blocklist;\n\n$blocklist = new Blocklist();\n\n// Check if disposable\n$blocklist-\u003eis_disposable( 'user@tempmail.com' );     // true\n$blocklist-\u003eis_disposable( 'user@gmail.com' );        // false\n\n// Check if blocked (includes custom blocked domains)\n$blocklist-\u003eis_blocked( 'user@tempmail.com' );        // true\n\n// Check if explicitly allowed\n$blocklist-\u003eis_allowed( 'user@company.com' );         // false\n```\n\n### Custom Blocked/Allowed Domains\n\n```php\n// Via constructor\n$blocklist = new Blocklist(\n    blocked: ['competitor.com', 'banned.org'],\n    allowed: ['partner.com', 'trusted.org']\n);\n\n// Or fluent methods\n$blocklist = new Blocklist();\n$blocklist-\u003eblock( ['competitor.com', 'banned.org'] );\n$blocklist-\u003eallow( ['partner.com', 'trusted.org'] );\n\n// Single domain\n$blocklist-\u003eblock( 'spammer.com' );\n$blocklist-\u003eallow( 'friend.com' );\n\n// Remove from custom lists\n$blocklist-\u003eunblock( 'competitor.com' );\n$blocklist-\u003edisallow( 'partner.com' );\n\n// Clear all custom entries\n$blocklist-\u003eclear();\n```\n\n### With Email Objects\n\nWorks with any object that has a `domain()` method:\n\n```php\nuse ArrayPress\\EmailUtils\\Email;\nuse ArrayPress\\EmailBlocklist\\Blocklist;\n\n$email = Email::parse( 'user@tempmail.com' );\n$blocklist = new Blocklist();\n\nif ( $email \u0026\u0026 $blocklist-\u003eis_disposable( $email ) ) {\n    // Reject\n}\n```\n\n### Custom Data Path\n\n```php\n// Use a custom directory for data files\n$blocklist = new Blocklist(\n    data_path: '/path/to/your/data'\n);\n```\n\n## How It Works\n\nThe library uses array flipping for O(1) lookups:\n\n```php\n// Instead of O(n) search through 170k domains\nin_array( $domain, $huge_list );  // Slow\n\n// We use O(1) hash lookup\nisset( $flipped_list[ $domain ] );  // Instant\n```\n\nSubdomain matching is supported — if `tempmail.com` is blocked, `sub.tempmail.com` is also blocked.\n\n## Priority Order\n\nWhen checking an email:\n\n1. **Custom allowlist** — If domain is in custom allowlist, allowed\n2. **Built-in allowlist** — If domain is in source allowlist, allowed\n3. **Custom blocklist** — If domain is in custom blocklist, blocked\n4. **Disposable list** — If domain matches disposable list, blocked\n5. **Default** — Allow\n\n## Available Methods\n\n| Method | Returns | Description |\n|--------|---------|-------------|\n| `is_disposable($email)` | `bool` | Check if email is from disposable provider |\n| `is_blocked($email)` | `bool` | Check if email is blocked (disposable + custom) |\n| `is_allowed($email)` | `bool` | Check if email is in allowlist |\n| `block($domains)` | `self` | Add domain(s) to custom blocklist |\n| `allow($domains)` | `self` | Add domain(s) to custom allowlist |\n| `unblock($domain)` | `self` | Remove domain from custom blocklist |\n| `disallow($domain)` | `self` | Remove domain from custom allowlist |\n| `get_blocked()` | `array` | Get custom blocked domains |\n| `get_custom_allowed()` | `array` | Get custom allowed domains |\n| `clear()` | `self` | Clear all custom entries |\n| `count()` | `int` | Count of disposable domains |\n\n## Data Source\n\nThis library uses data from:\n- [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains)\n\nThe list contains ~170,000 disposable email domains and is actively maintained.\n\n## Requirements\n\n- PHP 8.0+\n\n## License\n\nGPL-2.0-or-later","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Femail-blocklist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Femail-blocklist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Femail-blocklist/lists"}