MyBB Community Forums

Full Version: import mass spam mails into mybb disallowed emails list?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey was woundring
how to import mass spam mails list into mybb disallowed emails list?
in acp there is option just for adding emails one by one.
No, there is no mass email ban. Yu don't need it, though. There are millions of spam email addresses, the likelyhood they'll use one of the ones you have blocked is low. I would reccommend the Stop Forum Spam plugin, which checks the largest database of spam IPs/emails in the world.
If you have a list of emails, for example:

*.ru
*.spam-emails.com

Then you can import them with this script:

<?php

set_time_limit(0);

define("IN_MYBB", 1);

require("global.php");

$lines = file('spam_emails.txt'); 

foreach ($lines as $n => $l) 
{

	$ban = array('fid' => NULL,
				 'filter' => $l,
				 'type' => 3,
				 'dateline' => TIME_NOW
				);

	$db->insert_query("banfilters", $ban);
}

?>

I haven't tested it out but it should work.
I believe you have to also update the ban cache after inserting all the queries, but I could be wrong.
(2011-11-20, 04:12 PM)Malcolm. Wrote: [ -> ]If you have a list of emails, for example:

*.ru
*.spam-emails.com

Then you can import them with this script:

<?php

set_time_limit(0);

define("IN_MYBB", 1);

require("global.php");

$lines = file('spam_emails.txt'); 

foreach ($lines as $n => $l) 
{

	$ban = array('fid' => NULL,
				 'filter' => $l,
				 'type' => 3,
				 'dateline' => TIME_NOW
				);

	$db->insert_query("banfilters", $ban);
}

?>

I haven't tested it out but it should work.

worked great thanks.
It doesn't work with 1.6.X, please check if I was wrong.
(2012-11-12, 04:37 PM)NNT_ Wrote: [ -> ]It doesn't work with 1.6.X, please check if I was wrong.

It was designed for MyBB 1.6. If it doesn't work you're not using it correctly.
How can you import using a script? Help? I need this badly. Thanks in advance.