diff --git a/src/modules/Spamchecker/Service.php b/src/modules/Spamchecker/Service.php index 4bb91ce49..1d2c7a172 100644 --- a/src/modules/Spamchecker/Service.php +++ b/src/modules/Spamchecker/Service.php @@ -1,4 +1,5 @@ di['cache']->get('CentralAlerts.getAlerts', function (ItemInterface $item) { - $item->expiresAfter(604800); // Retain the DB cache for one week and then fetch the list again + $item->expiresAfter(86400); // The list is updated once every 24 hours, so we will cache it for that long $client = HttpClient::create(); - $response = $client->request('GET', 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/master/disposable_email_blocklist.conf'); + $response = $client->request('GET', 'https://raw.githubusercontent.com/7c/fakefilter/main/txt/data.txt'); $dbPath = PATH_CACHE . DIRECTORY_SEPARATOR . 'tempEmailDB.txt'; if ($response->getStatusCode() === 200) { - file_put_contents($dbPath, $response->getContent()); + @file_put_contents($dbPath, $response->getContent()); } else { + $item->expiresAfter(3600); return []; } @$database = file($dbPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); @unlink($dbPath); if (!$database) { + $item->expiresAfter(3600); return []; } - return array_filter($database, fn($domain) => filter_var($domain, FILTER_VALIDATE_DOMAIN)); + return array_filter($database, fn ($domain) => !str_starts_with($domain, '#') && filter_var($domain, FILTER_VALIDATE_DOMAIN)); }); } } diff --git a/src/modules/Spamchecker/html_admin/mod_spamchecker_settings.html.twig b/src/modules/Spamchecker/html_admin/mod_spamchecker_settings.html.twig index cfd30ed5c..ecdca878d 100644 --- a/src/modules/Spamchecker/html_admin/mod_spamchecker_settings.html.twig +++ b/src/modules/Spamchecker/html_admin/mod_spamchecker_settings.html.twig @@ -114,6 +114,7 @@
{{ 'If enabled, email addresses will be checked against a database of disposable email domains.'|trans }}
+{{ 'This database is updated daily and provided free of charge by the FakeFilter project under the BSD 3-Clause License.'|trans }}