Commit 13dd0521 authored by Francois Marier's avatar Francois Marier

antispam: if no MX found, check for A and AAAA

LP: #604954
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 29910c9e
......@@ -37,15 +37,18 @@ require_once('SimpleSpamTrap.php');
*/
class AdvancedSpamTrap extends SimpleSpamTrap {
// TODO: in addition to checking for an MX record, connect to the mailserver
// and see if the email address exists. This will detect the case where
// a nonexistant email at a valid domain is used.
protected function valid_email($email) {
if (!parent::valid_email($email)) {
return false;
}
list($local, $domain) = explode('@', $email);
return checkdnsrr($domain);
// TODO: we could connect to the mailserver and see if the
// email address exists. This will detect the case where a
// nonexistant email at a valid domain is used.
// If an MX record is not found, mail goes to the A or AAAA record
return checkdnsrr($domain, 'MX') or checkdnsrr($domain, 'A') or checkdnsrr($domain, 'AAAA');
}
protected function blacklisted_url($url) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment