Author Topic: [MOD] Bad Domain Mail Checker  (Read 11759 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
[MOD] Bad Domain Mail Checker
« on: July 10, 2009, 01:16:52 PM »
I found out that many spam bots are registering on my site with domain such as mail.ru, nlist.ru etc.

So I decided to disable new registration from those domains and here is small mod that will do that:

1. Add new row in 4images_settings table:
Code: [Select]
ALTER TABLE 4images_settings
ADD bad_mail

2. Open /includes/functions.php and before
Code: [Select]
?>

add

Code: [Select]
function mailCheck($user_email) {
global $site_db, $config;
$user_email = strtolower($user_email);
$return = 'true';
if ($config['bad_mail'] > '') {
$BadMailList = explode("\r\n", $config['bad_mail']);
$j = count($BadMailList);
for ($i = 0;$i < $j;++$i) {
if (eregi($BadMailList[$i], $user_email)) $return = 'false';
}
}
return $return;
}

3. Open register.php and before
Code: [Select]
if ($user_password == "") {
add

Code: [Select]
   if (mailCheck($user_email) == "false") {
      $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
      $error = 1;
    }

4. Open admin/settings.php and after:
Code: [Select]
show_setting_row("highlight_admin", "radio");
add
Code: [Select]
show_setting_row("bad_mail", "textarea");
Now you can in admin settings add bad domain names that you want to banned from registration; one after another.

Example:
aravensoft.com
bk.ru
list.ru
mail.ru
mysite.com
ya.ru
yoursite.com

You are welcome to test this mod first and add you suggestion how to improve it.

Enjoy!
« Last Edit: July 10, 2009, 01:32:35 PM by Lucifix »

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: [MOD] Bad Domain Mail Checker
« Reply #1 on: July 10, 2009, 02:17:48 PM »
very nice!
Thank you!

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Bad Domain Mail Checker
« Reply #2 on: July 15, 2009, 04:12:15 PM »
Glad that you like it.

Can you confirm if it's working correct?

Offline Hoelsch

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Fotos-von-gestern.de
Re: [MOD] Bad Domain Mail Checker
« Reply #3 on: October 28, 2009, 03:20:57 PM »
Hi,

it's working fine for me.

The only thing I found is you forgot the language entry:

Open /lang/your_language/admin.php and find:
Code: [Select]
?>BEFORE add:
Code: [Select]
$setting['bad_mail'] = "Zu blockierende Mail Hosts eingeben:";
If you don't add this there is a empty textfield at admin settings only.

Just a correction to make it looking better ;-)

And I made a list with the most famous trashmail pages:

Code: [Select]
trash-mail.com
trash-mail.de
spambog.com
spambog.de
discardmail.com
discardmail.de
spambog.ru
cust.in
imails.info
great-host.in
teewars.org
kulturbetrieb.info
bio-muesli.net
bio-muesli.info
0815.ru
sandelf.de
recode.me
3d-painting.com
nomail2me.com
sofort-mail.de
dodgit.com
mailinator.com
jetable.org
spam.la
mt2009.com
trash2009.com
trashymail.com
mytrashmail.com
e4ward.com
kasmail.com
iximail.com
kas-group.com
spamgourmet.com
eintagsmail.de
hidemail.de
emailto.de

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: [MOD] Bad Domain Mail Checker
« Reply #4 on: October 28, 2009, 06:26:00 PM »
denying email adresses based on domain name is a bad practice...
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.