# Some tests with respect to what to do about FH_DATE_PAST_20XX in the long term # I fully expect this to include too many steps, most of which will never # see hits. Likely we'll either conclude the single step (96h+) is enough # or one or two steps beyond it is optimal. FH_DATE_PAST_20XX's high scores # (1.536 2.699 2.390 2.564 as of r891460 on 20091216) certainly make it seem # worthwhile to the GA... ifplugin Mail::SpamAssassin::Plugin::HeaderEval header DATE_IN_FUTURE_96_WEEK eval:check_for_shifted_date('96', '168') describe DATE_IN_FUTURE_96_WEEK Date: is 4 to 7 days after Received: date tflags DATE_IN_FUTURE_96_WEEK nopublish header DATE_IN_FUTURE_WEEK eval:check_for_shifted_date('168', '730') describe DATE_IN_FUTURE_WEEK Date: is a week to a month after Received: date tflags DATE_IN_FUTURE_WEEK nopublish # 'month' is calculated as 365/12*24, which is actually 30 days and 10 hours header DATE_IN_FUTURE_MONTH eval:check_for_shifted_date('730', '2920') describe DATE_IN_FUTURE_MONTH Date: is 1 to 4 months after Received: date tflags DATE_IN_FUTURE_MONTH nopublish # 'year' is represented here as 366 days and one hour header DATE_IN_FUTURE_YEAR eval:check_for_shifted_date('2920', '8785') describe DATE_IN_FUTURE_YEAR Date: is 4 months to a year after Received: date tflags DATE_IN_FUTURE_YEAR nopublish # 'year' (366d+1h) to 4-year (4*365*24+24, which accounts for leap year) header DATE_IN_FUTURE_1Y_4Y eval:check_for_shifted_date('8785', '35064') describe DATE_IN_FUTURE_1Y_4Y Date: is 1 to 4 years after Received: date tflags DATE_IN_FUTURE_1Y_4Y nopublish header DATE_IN_DISTANT_FUTURE eval:check_for_shifted_date('35064', 'undef') describe DATE_IN_DISTANT_FUTURE Date: is over 4 years after Received: date tflags DATE_IN_DISTANT_FUTURE nopublish # Expected stats: 0.1782/0.0029 Spam%/Ham% at 0.984 S/O # Actual: 0.1065/0.0029 Spam%/Ham% at 0.974 S/O @ 20100207 # 0.0723/0.0033 spam/ham at 0.956 s/o @ 20100212 header DATE_IN_FUTURE_96_Q eval:check_for_shifted_date('96', '2920') describe DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: date # Expected stats: 0.2469/0.0008 Spam%/Ham% at 0.997 S/O and a higher 'Rank' # Actual: 0.1515/0.0011 Spam%/Ham% at 0.993 S/O @ 20100207 # 0.5497/0.0038 spam/ham at 0.993 s/o @ 20100212 header DATE_IN_FUTURE_Q_PLUS eval:check_for_shifted_date('2920', 'undef') describe DATE_IN_FUTURE_Q_PLUS Date: is over 4 months after Received: date endif