Jump to content
qbert

[PHP] Junk Emails Remover

Recommended Posts

Posted

Ideea scriptului mi-a venit mai demult,cand dupa cateva zile de eforturi in incercarea de a imi face o chestie fud,am avut norocul ca printre mailurile spamate cu chestia fud,sa se afle niste mailuri @bitdefender.com si niste mailuri @eset.ro .Deci nu mare mi-a fost mirarea cand la vreo 2-3 ore dupa spam,am vazut ca s-a dus pe coaie fud-ul meu.

Deci ce face: Elimina din liste de emailuri (emailuri separate cu \n (newline)) emailuri ce apartin unor domenii nedorite de spammer.

<?php

/*

Title: Junk Emails Remover

Description: This script is designed to remove unwanted TLDs from your mailing list.

Author: qbert

Links : qbert.tor.hu

rstcenter.com

*/

$file = 'mails.txt'; // Your mailing list

$unwanted_tlds = array('gov.ro','bitdefender.ro','bitdefender.com','nasa.gov','avastantivirus.ro','avast.com',

'eset.ro','eset.com','piraeusbank.ro','bnro.ro','atebank.ro','raiffeisen.ro','ing.ro',

'avira.com','cec.ro','bcr.ro','librabank.ro','gemoney.ro','garantibank.ro','emporiki.ro',

'librabank.ro','procreditbank.ro','egnatiabank-rom.ro','millenniumbank.ro','leumi.ro',

'romexterra.ro','kaspersky.ro','kaspersky.com','avg.com','mcafee.com','symantec.com',

'norton.com','clamav.net'); // TLDs to be removed

$mail_list = fopen($file ,'r');

$tlds_num = count($unwanted_tlds);

$tlds_num = $tlds_num - 1;

$j = 0;

$malicious = 0;

while ($j <= $tlds_num){

$num_lines = count(file($file));

$i = 0;

$temp_file = file($file);

while ($i < $num_lines){

$check = strpos($temp_file[$i],$unwanted_tlds[$j]);

if($check != NULL){

$malicious++;

unset($temp_file[$i]);

$mail_list = fopen($file ,'w+');

foreach($temp_file as $key => $value){

fwrite($mail_list,$value);

}

}

$i++;

}

$j++;

}

fclose($mail_list);

echo 'd0ne!' . $malicious . ' malicious email adresses were removed!';

?>

Pastebin:

 <?php /* Title: Junk Emails Remover Description: This - Pastebin.com
  • Upvote 1
Posted

Pai doar daca adaugi .gov in array-ul tld-urilor ce urmeaza sa fie sterse ,sunt eliminate toate .gov-urile, inclusiv subdomeniile gen research.nasa.gov.Ah,si array-ul poate fi editat cum vrei,cu ce domenii vrei sa fie excluse nu sunt doar astea predefinite.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...