[antispam-f] Re: User Tests

  • From: Harriet Bazley <lists@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: antispam@xxxxxxxxxxxxx
  • Date: Sun, 06 Apr 2008 22:23:05 +0100

On 4 Apr 2008 as I do recall,
          Dave Barnett  wrote:

> A few weeks ago Harriet offered a test to spot domains that were all 
> in capitals.  I copied the code but failed to get it working.  At the 
> time, I was more occupied sorting out the mess that I had made 
> updating Messenger, and have lost the original posting.
> 
> Now, amongst the current spam tsunami, I am finding increasing numbers 
> of spams with the domain part of the 'From:' header in capitals.   Is 
> there any further advice that I missed and that might help?
> 
This is the code that I posted at the time


DEF FN@domaincaps
LOCAL loop%,uppercount%,end$,letter%
end$=FNgetdomain(D$)
REM "Vadim Moos" <_mlifrate@xxxxxxxxxxxxx>

IF LEN(end$)<1 THEN =FALSE
FOR loop%=1 TO LEN(end$)
  letter%=ASC(MID$(end$,loop%,1))
  IF user_uppercase%?letter% = letter% THEN uppercount%+=1
NEXT
IF uppercount%=LEN(end$) THEN =TRUE
=FALSE

DEF FNgetdomain(in$)
LOCAL ptr%,domain$
ptr%=INSTR(in$,"@")
domain$=MID$(in$,ptr%+1)
domain$=LEFT$(domain$)
REM trim angle brackets
=domain$


with the proviso that you also need to set up the 'uppercase table' in
the (by default blank) PROCUserTest_Initialise at the start of the file,
which is probably the bit that threw you:

DIM user_uppercase% 255
SYS"Territory_UpperCaseTable",-1 TO ptr%
FOR n%=0 TO 252 STEP 4
  user_uppercase%!n%=ptr%!n%
NEXT n%
REM take copy of uppercase table


N.B. I haven't actually tested this code in a 'blank' copy of UserTests
- I just pasted it out of my own highly-customised file - so it's
possible that there might be other dependencies that I hadn't
realised....

-- 
Harriet Bazley                     ==  Loyaulte me lie ==

"An American is a man with two arms and four wheels".

Other related posts: