@maartenvonz
To answer your questions..
I was thinking about the size that the text file will become. I've only had it installed 2 days, and my email list is already 1481 lines long, and the domain 67.
Size is limited by the amount of memory set in your php.ini file, the size of the text file is not the problem.
Another problem I have picked up is the use by the spammers of sub-domains, which are not picked up by just adding the TLD to the domain list.
Your answer restricts the subdomain some what and is a lot of lines..
Not sure if my answer would be backward compatible for older php... but works with php7.3.x
Code:
@list($name, $domain) = explode("@", $email); //explode the address into strings, name and domain, lose the @
$dword = explode(".", $domain); //explode the domain into an array, lose the dot
$tof = false;
foreach($dword as $what) {
if(in_array($what, $domainlist)) {
$tof = true; // we have a match
}
}
if(in_array($email, $emaillist) || in_array($domain, $domainlist) || $tof) {
However, you need to add the word in the banned_domain.txt
For in_array() needs a excite match. I should change this to a regex line someday.. what this means you need correct words in banned_domain.txt.. so if you add addme without the .com it would match addme.addus.addyou.ccom
Caution, if you do above code change, you can block countries by adding ccom no one with a email address ending with .ccom well ever be allowed to create an account or send you emails...
I still need to do an update to this mod, but been getting sided track with other things.. well add this at that time with instructions/cautions.
Bookmarks