From: Art Cancro Date: Fri, 28 Jul 2023 03:38:22 +0000 (-0400) Subject: If a domain is not found and consists of more than two parts, try it by stripping... X-Git-Url: https://code.citadel.org/help?a=commitdiff_plain;h=9007a7a37eb9329cb03d3b82c319efb066c7c368;p=infanticide.git If a domain is not found and consists of more than two parts, try it by stripping parts one by one --- diff --git a/infanticide.pm b/infanticide.pm index 3ad11d8..56072fd 100755 --- a/infanticide.pm +++ b/infanticide.pm @@ -53,6 +53,17 @@ sub infanticide_get_creation_date { # 2017-06-02T13:15:42Z } } + if ($cDate eq "") { + syslog('debug', "infanticide: no creation date for " . $domain_to_test); + + # If the FQDN is made up of more than two components (for example, mail.spammers.com) + # try stripping components until it's down to two + $dots = ($domain_to_test =~ tr/.//); + if ($dots > 1) { + return(infanticide_get_creation_date(substr $domain_to_test, index($domain_to_test, ".")+1)); + } + + } return($cDate); } @@ -66,7 +77,6 @@ sub check_for_disposable_domain() { my $domain = $fromarr[1]; my $creationDate = infanticide_get_creation_date($domain); if ($creationDate eq "") { - syslog('debug', "infanticide: no creation date for " . $domain); return(0); } my $dt = str2time($creationDate);