Jump to content
sLIDe

Temporary e-pastu bloķēšana

Recommended Posts

Ar šī skripta palīdzību ir iespējams par 99% nogriezt kontu reģistrāciju no pagaidu e-pastiem.

<?php
$db = new mysqli('localhost', 'root', 'password', 'database');

function addEmails($db, $emails){
	foreach( $emails as $email ){
		$email = trim($email);
		if( empty($email) ){
			continue;
		}
		$email = $db->real_escape_string($email);
		$q = $db->query("SELECT `ban_content` FROM `has_core_banfilters` WHERE `ban_content` = '*@$email'");
		if( $q && $q->num_rows ){
			continue;
		}
		$db->query("INSERT INTO `has_core_banfilters` SET `ban_content` = '*@$email', `ban_type` = 'email', `ban_date` = UNIX_TIMESTAMP(), `ban_reason` = 'disposable'");
	}
}

$listUrl = 'https://gist.githubusercontent.com/michenriksen/8710649/raw/e09ee253960ec1ff0add4f92b62616ebbe24ab87/disposable-email-provider-domains';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://gist.githubusercontent.com/michenriksen/8710649/raw/e09ee253960ec1ff0add4f92b62616ebbe24ab87/disposable-email-provider-domains';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/MattKetmo/EmailChecker/master/res/throwaway_domains.txt';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/martenson/disposable-email-domains/master/disposable_email_blacklist.conf';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/andreis/disposable-email-domains/master/domains.txt';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/wesbos/burner-email-providers/master/emails.txt';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://gist.githubusercontent.com/hassanazimi/d6e49469258d7d06f9f4/raw/3290da2d85dbce01b37e5fd4fcc219778bd69b35/disposable_email_addresses';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/lavab/disposable/master/domains.json';
$list = file_get_contents($listUrl);
$emails = json_decode($list, true);
addEmails($db, $emails);

$listUrl = 'https://raw.githubusercontent.com/willwhite/freemail/master/data/disposable.txt';
$list = file_get_contents($listUrl);
$emails = explode("\n", $list);
addEmails($db, $emails);

$emails = [
	'*now.im',
	'*ftp.sh',
	'*grn.cc',
	'*betr.co',
];
addEmails($db, $emails);

Izmantot kā Cron Job reizi stundā.

Strādā arī uz IPB 3.4.x tikai jānomaina tabulas nosaukums (struktūra tāda pati)

P.S. Ja nu zinat vēl kādu listu, kur ir pieejams saraksts ar šiem e-pastu sniedzējiem, tad padalieties un pieliksim klāt.

  • Upvote 11

Share this post


Link to post
Share on other sites

Atjaunoti nestrādājošie linki un pieliktas papildus sources

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.