[Gllug] Perl Question - Spam Filter for NMS Form Mail

James Laver gllug at jameslaver.com
Sun Feb 8 20:11:11 UTC 2009


On Sun, February 8, 2009 1:15 am, Henry Gilbert wrote:
> 2009/2/7 Lesley Binks <lesleyb at pgcroft.net>:
>> You'd get more mileage out of this if you wrote your own contact form
>> and you could then add a recaptcha.net anti-spam offering.
>>
>> You only need two or three text fields, a text area and a submit button
>> plus the recaptcha.net javascript

The wonderful thing about relying on javascript is that you get people who
actually give a damn about accessibility on your back. You do want to
alienate blind people who have to use screen readers, don't you? This is
aside from the fact that in the UK this is covered under the DDA and
similar laws in other countries. The RNIB recommend WCAG-AA compliance.
Don't let this stop you however, I'm sure blind people everywhere wouldn't
want to put you out and demand you write 8 lines of perl.

> With the holiday website - I just need 2 extra lines of Perl code to
> reduce spam to (near) zero. It is only one type of spam that is
> evading the current filter. The format being a long list of URLs all
> starting with http://
>

elsif ($messagecheck =~ m|://|) {
  print "Location: http://www.google.com\n\n";
  exit;
}
elsif (length $messagecheck > 1000) {
  print "Location: http://www.google.com\n\n";
  exit;
}

This will do exactly as you asked in your original email. The script could
do with some restructuring generally, but provided this is about as
complex as it's going to get, it's probably not worth it.

HTH,
-J
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list