Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2017-05-27 13:11:28

ttb_us
New member
Registered: 2017-05-27
Posts: 3

ban email domain wild cards

Hello
Is there a way to ban email domain, well it would be a sub domain as I see it. domains like @bbpoczta.s3.lolekemail.net. so the tld is lolekemail.net but it still allows @bbpoczta.s3.lolekemail.net to register.

wildcards like @*.lolekemail.net give error the domain format is incorrect when trying to ban. bbpoczta.s3.lolekemail.net will work, but the next thing you know is it changes to bbpoczta.lolekemail.net.

so is there any wildcards for ban email domains?

Offline

#2 2017-05-27 13:56:58

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,182
Website

Re: ban email domain wild cards

in include/email.php replace

//
// Check if $email is banned
//
function is_banned_email($email)
{
	global $pun_bans;

	foreach ($pun_bans as $cur_ban)
	{
		if ($cur_ban['email'] != '' &&
			($email == $cur_ban['email'] ||
			(strpos($cur_ban['email'], '@') === false && stristr($email, '@'.$cur_ban['email']))))
			return true;
	}

	return false;
}

to

//
// Check if $email is banned
//
function is_banned_email($email)
{
	global $pun_bans;

	foreach ($pun_bans as $cur_ban)
	{
		if (empty($cur_ban['email'])) {
			continue;
		}

		if (false === strpos($cur_ban['email'], '@')) {
			$len = strlen($cur_ban['email']);
			if ($cur_ban['email'][0] == '.') {
				if (substr($email, -$len) == $cur_ban['email']) {
					return true;
				}
			} else {
				$tmp = substr($email, -1-$len);
				if ($tmp == '.'.$cur_ban['email'] || $tmp == '@'.$cur_ban['email']) {
					return true;
				}
			}
		} else if ($email == $cur_ban['email']) {
			return true;
		}
	}

	return false;
}

Examples:
ban = exemple.com -> stop: user.name@exemple.com, user.name@www.exemple.com;
ban = .org -> stop: all .org domains;

P.S. Need TEST!

Offline

#3 2017-05-27 14:30:44

ttb_us
New member
Registered: 2017-05-27
Posts: 3

Re: ban email domain wild cards

Visman wrote:

in include/email.php replace
P.S. Need TEST!

Thanks
don't mined testing, but when version upgrade comes the file email.php will have to be edited again, correct?

I only speak English and not so good.

Offline

#4 2017-05-28 11:30:21

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: ban email domain wild cards

When you upgrade your FluxBB version this file must be updated as well, yes.

Offline

#5 2017-05-29 11:53:38

ttb_us
New member
Registered: 2017-05-27
Posts: 3

Re: ban email domain wild cards

Yup!
nice! worked, one test.

Ага!
хороший! Работал, одно испытание.
Ты умеешь читать по-русски?

Offline

#6 2017-10-12 08:48:46

delos
New member
Registered: 2017-10-11
Posts: 3

Re: ban email domain wild cards

Hi, thanks for this mod, but there is just one thing I don't understand.
Where do I set this:

Examples:
ban = exemple.com -> stop: user.name@exemple.com, user.name@www.exemple.com;
ban = .org -> stop: all .org domains;

?? Thanks.

ps: i'm on the 1.2 version.

Last edited by delos (2017-10-12 09:00:45)

Offline

#7 2018-10-13 16:05:53

DC Matt
New member
Registered: 2018-10-13
Posts: 1

Re: ban email domain wild cards

delos wrote:

Hi, thanks for this mod, but there is just one thing I don't understand.
Where do I set this:

Examples:
ban = exemple.com -> stop: user.name@exemple.com, user.name@www.exemple.com;
ban = .org -> stop: all .org domains;

?? Thanks.

ps: i'm on the 1.2 version.


Same question here?
I've made the changes to the email.php file, but how do I define which domains I want to ban?

Offline

#8 2018-10-14 17:35:39

DarkZero
Member
From: France
Registered: 2015-03-11
Posts: 7

Re: ban email domain wild cards

Hello,

If you want to ban disposable email provider, you can check this : https://github.com/MattKetmo/EmailChecker
It provides a built-in database of 1000+ disposable email providers. It is updated very regularly (for a free database)

Here is the complete list :
https://github.com/MattKetmo/EmailCheck … omains.txt

Offline

Board footer

Powered by FluxBB