disposable-email-domains: The Essential Blocklist for Temporary Email Domains

disposable-email-domains: The Essential Blocklist for Temporary Email Domains

Summary

The `disposable-email-domains` repository provides a crucial list of temporary and disposable email domains, widely used to prevent spam and abuse on online services. This comprehensive blocklist helps developers and administrators identify and block registrations from throw-away email addresses. Notably, it is utilized by PyPI to maintain the integrity of its user base, making it a highly reliable resource for enhancing platform security.

Repository Info

Updated on October 12, 2025
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

The disposable-email-domains GitHub repository offers a vital resource: a meticulously maintained list of disposable and temporary email address domains. These domains are frequently exploited for creating dummy user accounts, facilitating spam, or abusing online services. By integrating this blocklist, developers can significantly enhance the security and integrity of their platforms, preventing fraudulent registrations and mitigating potential abuse.

A testament to its reliability, this list is actively used by PyPI, the Python Package Index, to block registrations from known throw-away email domains. The repository also includes an allowlist.conf file, which gathers email domains that might be mistakenly identified as disposable but are, in fact, legitimate.

Installation

Integrating the disposable-email-domains blocklist into your project is straightforward. You can directly download the disposable_email_blocklist.conf file from the GitHub repository.

For Python developers, a convenient PyPI module is available, simplifying integration:

pip install disposable-email-domains

Examples

The repository provides examples for integrating the blocklist across various programming languages. Here are a few common implementations:

Python

Using the PyPI module:

from disposable_email_domains import blocklist

email_domain = 'bearsarefuzzy.com'
if email_domain in blocklist:
    print(f"'{email_domain}' is a disposable email domain.")
else:
    print(f"'{email_domain}' is not a disposable email domain.")

PHP

function isDisposableEmail($email, $blocklist_path = null) {
    if (!$blocklist_path) $blocklist_path = __DIR__ . '/disposable_email_blocklist.conf';
    $disposable_domains = file($blocklist_path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    $domain = mb_strtolower(explode('@', trim($email))[1]);
    return in_array($domain, $disposable_domains);
}

// Example usage:
// if (isDisposableEmail("test@example.com")) { /* ... */ }

Go

import ("bufio"; "os"; "strings";)

var disposableList = make(map[string]struct{}, 3500)

func init() {
    f, _ := os.Open("disposable_email_blocklist.conf")
    for scanner := bufio.NewScanner(f); scanner.Scan(); {
        disposableList[scanner.Text()] = struct{}{}
    }
    f.Close()
}

func isDisposableEmail(email string) (disposable bool) {
    segs := strings.Split(email, "@")
    _, disposable = disposableList[strings.ToLower(segs[len(segs)-1])]
    return
}

// Example usage:
// if isDisposableEmail("test@example.com") { /* ... */ }

Node.js

import { readFile } from 'node:fs/promises'

let blocklist

async function isDisposable(email) {
  if (!blocklist) {
    const content = await readFile('disposable_email_blocklist.conf', { encoding: 'utf-8' })
    blocklist = content.split('\r\n').slice(0, -1)
  }
  return blocklist.includes(email.split('@')[1])
}

// Example usage:
// isDisposable("test@example.com").then(result => console.log(result));

Why Use It?

Utilizing the disposable-email-domains blocklist is a proactive measure for any online service or application that requires user registration. By preventing registrations from temporary email addresses, you can:

  • Combat Spam and Abuse: Significantly reduce the influx of spam accounts and deter users attempting to bypass restrictions or abuse services.
  • Improve Data Quality: Ensure that your user base consists of legitimate individuals with permanent contact information, leading to more reliable user data.
  • Enhance Security: Add a layer of defense against various forms of online fraud and malicious activities often associated with throw-away email accounts.
  • Reduce Operational Costs: Minimize the resources spent on moderating and cleaning up fake accounts or dealing with issues stemming from temporary registrations.

Links