From: Art Cancro Date: Thu, 1 Jun 2023 23:39:19 +0000 (-0400) Subject: Round up days_ago to the next highest integer X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=5a32da4c5a5184bf9298ed571a24e1c8259ae313;p=infanticide.git Round up days_ago to the next highest integer --- diff --git a/infanticide.pm b/infanticide.pm index e45a292..3ad11d8 100755 --- a/infanticide.pm +++ b/infanticide.pm @@ -9,8 +9,8 @@ package infanticide; use Mail::SpamAssassin::Plugin; use Sys::Syslog; use Sys::Syslog qw(:standard :macros); -#use Time::Local; use HTTP::Date; +use POSIX; our @ISA = qw(Mail::SpamAssassin::Plugin); @@ -66,11 +66,11 @@ sub check_for_disposable_domain() { my $domain = $fromarr[1]; my $creationDate = infanticide_get_creation_date($domain); if ($creationDate eq "") { - syslog('debug', "infanticide: " . $counter . " no creation date for " . $domain); + syslog('debug', "infanticide: no creation date for " . $domain); return(0); } my $dt = str2time($creationDate); - my $daysAgo = (time() - $dt) / 86400; + my $daysAgo = ceil((time() - $dt) / 86400); syslog("debug", "infanticide: " . $domain . " was created " . $daysAgo . " days ago"); if ($daysAgo < 30) { return(1);