[antispam-f] Re: Fake future dates

  • From: Harriet Bazley <lists@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: antispam@xxxxxxxxxxxxx
  • Date: Wed, 08 Nov 2006 22:00:32 GMT

After a number of these seemed to be slipping through, I discovered that
you can't rely on the dd mmm yyyy format after all   :-(
Messenger uses leading zeroes for single-digit dates, but these spams
are appearing without them, so string slicing based on number of
characters won't work.   I've rewritten the relevant part of the test to
split the date up by detecting spaces instead:


DEF FN@forward_dates
LOCAL d%,m%,y%,yearday%,excess%,thisyear%
LOCAL space%

excess%=3
REM number of days into future we will accept e-mail from(!)
IF INSTR(d$,",") THEN date$= MID$(d$,6,11) ELSE date$=LEFT$(d$,11)
REM dd mmm yyyy

d%=VAL(date$)
space%=INSTR(date$," ")

mon$=MID$(date$,space%+1,3)

m%=INSTR("jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec,",mon$+",")
m%=m%/4+1
REM get month number

space%=INSTR(date$," ",space%+1)
REM find next space after start of month string

date$=MID$(date$,space%+1)
y%=VAL(date$)

[...]
-- 
H. Bazley

USER ERROR: replace user and press any key to continue.

Other related posts: