Re: Integrated captcha?

"Alex Teslik" <[email protected]> Tue, 13 Jan 2009 17:10:32 -0700
Newsgroups gmane.mail.majordomo.majordomo2.devel
Message-ID <[email protected]>
Okay, so I finally had a moment to stare at this long enough to figure out how
to integrate captcha into the Mj2 wwwusr interface. I have attached the patch
set. Here are the instructions:

- Download and untar the patch set at your majordomo install directory (no
files are overwritten in your install). The directory structure of an Mj2
install is preserved so that it can be seen where every file should go (or
where you should go before applying the patches). I don't keep two source
trees to run a proper single unified diff, so no complaints please.

- Go into each directory where there is a .patch file and run:

patch < patchfile.patch

- Install the Authen::Captcha module:

http://search.cpan.org/~unrtst/Authen-Captcha-1.023/Captcha.pm

You need to patch Authen::Captcha because Mj2 runs in taint mode (-T switch)
and A::C doesn't untaint the $png_file variable properly before trying to
unlink the old ones. The untaint I use looks like:

($png_file) = $png_file =~ m/(.*)/; # force untaint

I put it in the logical place the error messages indicate (lines 2something
and 5something - I didn't write it down).

- Update the patched bin/mj_wwwusr file to put the png captcha images
somewhere logical on your server.

- Update any of the SITE/files/etc... with the http path to where you are
putting your captcha png files.

The other files included in the tgz are the error messages in case captcha
verification fails.

I took the SITE files and modified them to match the look and feel of our
mailing list. You can see what it all looks like here:

http://openwebmail.acatysmoof.com/archive/mj_wwwusr.pl?func=lists-long-full&extra=owm-users

Thanks,
Alex

On Sat, 06 Sep 2008 02:40:21 -0700, Michael Yount wrote
> Alex,
> 
> I'd be happy to answer specific questions about Mj2, but don't have 
> time to learn how captcha code is implemented.  If you could outline 
> what's required, that would be a good start.  Are the images created 
> on the fly, or is there a collection?  Are you intending to use an 
> existing perl module for captcha, or are you planning to write your own?
> 
> Michael
> 
> Alex Teslik wrote:
> > Bump.
> >
> > But seriously, any pointers on how to do this would be appreciated. MJ2 is
a little complex and the 
> > Right Way isn't immediately apparent after much digging.
> >
> > Thanks,
> > Alex
> >
> > On Sun, 17 Aug 2008 08:02:14 -0800, Alex Teslik wrote
> >   
> >> Hello,
> >>
> >>      We're having a problem lately where spammers are using our 
> >> subscription forms to mass email subscription requests. Its 
> >> pointless, since the subscriptions contain no messages from the 
> >> spammer - but its happening anyway. The end result is delivery 
> >> failures for tons of tokens (an annoyance to the list admins) and 
> >> the occasional blacklist of our IP from less intelligent mail 
> >> services (I'm looking at you Frontgate!).
> >>
> >>      A simple solution would seem to be integrating captcha into the 
> >> subscription page. It seems likely that this might be something 
> >> someone has already done? If anyone has any code to share I would 
> >> appreciate it.
> >>
> >>     If anyone has alternate suggestions to solve this problem that 
> >> would also be appreciated!
> >>
> >> Thanks,
> >> Alex
> >>     
> >
> >
> >
> >
captcha_patch.tgz (application/octet-stream, 2.3 KB) - not displayed
CONTENTS (application/octet-stream, 582 B) - not displayed