LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-14-2010, 04:23 AM   #1
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Rep: Reputation: 17
Unhappy captcha in squirrelmail


Please help me to insert captcha plugins in squirrelmail.
My installed SquirrelMail version 1.4.20 [SVN]-0.rc2.20100104.fc12
I download tar.gz file and extract it in the plugins directory. After that I executed conf.pl script and installed it.
When I try to login, the page display totally blank.
So please help me.
 
Old 03-14-2010, 09:41 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Running conf.pl is not enough.
You should select a backend (meaning a way to create the captcha image), by editing the config.php in the captcha directory.
Read the captcha/docs/INSTALL file for more details.

Regards
 
1 members found this post helpful.
Old 03-14-2010, 12:48 PM   #3
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
Thanks bathory,
I read INSTALL file,
I edit config.php file and insert this path there:
$captcha_backend = '/usr/share/squirrelmail/plugins/captcha/backends/textcaptcha';
and also copy textcaptcha_config_example.php to textcaptcha_config.php.
But got no result.
I am very new in Server configuration, please help me.
 
Old 03-14-2010, 01:32 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
$captcha_backend = '/usr/share/squirrelmail/plugins/captcha/backends/textcaptcha';
You don't need the whole path to the file, but only the name of the backend (in your case "textcaptcha"):
Code:
$captcha_backend = 'textcaptcha';
I suggest you to use the "captcha_php" or "watercap" (or you can use the more simpler csi, freecap, opencaptcha backends). All you need to do is to add gd support in php if it doesn't already has it.
 
Old 03-15-2010, 01:31 PM   #5
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
captcha in squirrelmail

Thanks bathory,

I changed that path. After that I found the following things in login page:

1. No image or text display in login page
2. A text box with a heading "Enter the text you see in the image above: "
3. I can' login with valid user name & password. Display the error message
"Sorry, you did not provide the correct challenge response."

I read textcaptcha_config.php file but can't understand then I create an images directory and change its group ownership apache and permission 770 as per INSTALL doc file. But got no result.

As per your advice I tried csi catch but got the previous result. There was no new result found.
 
Old 03-15-2010, 02:04 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure you have installed gd support for php? Since you didn't mention your distro, you should check with your package manager, if you have installed something like php-gd, or php5-gd or similar package.
You can also take a look at your web server logs to see what errors you get.

Regards
 
Old 03-17-2010, 09:33 AM   #7
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
Sorry bathory for delay reply.
Yes. I am sure
Quote:
[root@localhost ~]# rpm -qa | grep php*
php-gd-5.3.1-1.fc12.i686
openoffice.org-graphicfilter-3.1.1-19.14.fc12.i686
php-ldap-5.3.1-1.fc12.i686
hyphen-en-2.4-5.fc12.noarch
php-pdo-5.3.1-1.fc12.i686
hyphen-2.4-5.fc12.i686
xorg-x11-drv-elographics-1.2.3-4.fc12.i686
phonon-4.3.1-102.fc12.i686
phonon-backend-xine-4.3.1-102.fc12.i686
php-mysql-5.3.1-1.fc12.i686
boost-graph-1.39.0-8.fc12.i686
un-core-graphic-fonts-1.0.2-0.10.080608.fc12.noarch
xmlgraphics-commons-1.3-3.noarch
php-mbstring-5.3.1-1.fc12.i686
hyphen-bn-0.20090924-1.fc12.noarch
eclipse-callgraph-0.0.1-3.fc12.i686
kdegraphics-libs-4.3.2-3.fc12.i686
php-cli-5.3.1-1.fc12.i686
kdegraphics-4.3.2-3.fc12.i686
libgphoto2-2.4.7-2.fc12.i686
gvfs-gphoto2-1.4.1-3.fc12.i686
phonon-backend-gstreamer-4.3.1-102.fc12.i686
phonon-devel-4.3.1-102.fc12.i686
php-5.3.1-1.fc12.i686
php-common-5.3.1-1.fc12.i686
This is my webserver log message
Quote:
[root@localhost ~]# tail -f /var/log/httpd/access_log
::1 - - [15/Mar/2010:04:08:56 +0530] "GET /webmail HTTP/1.1" 301 308 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [15/Mar/2010:04:08:56 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [15/Mar/2010:04:24:47 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [15/Mar/2010:04:33:40 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [16/Mar/2010:04:20:55 +0530] "GET /webmail HTTP/1.1" 301 308 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [16/Mar/2010:04:20:56 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [16/Mar/2010:04:54:54 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [16/Mar/2010:05:04:35 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [18/Mar/2010:01:11:26 +0530] "GET /webmail HTTP/1.1" 301 308 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [18/Mar/2010:01:11:26 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
Quote:
[root@localhost ~]# tail -f /var/log/httpd/error_log
[Thu Mar 18 01:11:01 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Mar 18 01:11:01 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Mar 18 01:11:01 2010] [notice] Digest: done
[Thu Mar 18 01:11:02 2010] [error] python_init: Python version mismatch, expected '2.6', found '2.6.2'.
[Thu Mar 18 01:11:02 2010] [error] python_init: Python executable found '/usr/bin/python'.
[Thu Mar 18 01:11:02 2010] [error] python_init: Python path being used '/usr/lib/python26.zip:/usr/lib/python2.6/:/usr/lib/python2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-dynload'.
[Thu Mar 18 01:11:02 2010] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Mar 18 01:11:02 2010] [notice] mod_python: using mutex_directory /tmp
[Thu Mar 18 01:11:03 2010] [notice] Apache/2.2.13 (Unix) DAV/2 PHP/5.3.1 mod_python/3.3.1 Python/2.6.2 mod_ssl/2.2.13 OpenSSL/1.0.0-fips-beta3 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Thu Mar 18 01:11:03 2010] [error] avahi_entry_group_add_service_strlst("192.168.1.2") failed: Invalid host name
 
Old 03-17-2010, 09:51 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure you've posted the correct logs? Maybe you're running squirrelmail as a vhost with different log files.
Because I don't see any hit to squirrelmail login.php page

Also since you're running Fedora make sure it's not a SELinux problem

Regards

Last edited by bathory; 03-17-2010 at 09:54 AM.
 
Old 03-18-2010, 12:37 PM   #9
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
before do anything, I just disable selinux by setenforce 0.
Ok I try to find proper log file.
Please give me two days.
 
Old 03-20-2010, 10:21 PM   #10
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
sorry friend I can't find any other log file related this. I think am doing some thing wrong in captcha plugins directory. Can you guide me to configure textcaptcha?

This is my config.php in captch directory.
Quote:
$captcha_backend = 'textcaptcha';
Is it any thing to be configure in ./backends/textcaptcha location????
I give here details of that directory:
Quote:
[root@localhost textcaptcha]# pwd
/usr/share/squirrelmail/plugins/captcha/backends/textcaptcha
[root@localhost textcaptcha]# ls -l
total 32
-rw-r--r--. 1 root root 3345 2010-03-21 01:31 image_generator-1.5.2plus.php
-rw-r--r--. 1 root root 1454 2010-03-21 01:31 image_generator.php
drwxr-x---. 2 root root 4096 2010-03-21 01:31 images
-rw-r--r--. 1 root root 466 2010-03-21 01:31 index.php
-rw-r--r--. 1 root root 1282 2010-03-21 01:31 textcaptcha_config_default.php
-rw-r--r--. 1 root root 1282 2010-03-21 01:31 textcaptcha_config_example.php
-rw-r--r--. 1 root root 1282 2010-03-21 01:31 textcaptcha_config.php
-rw-r--r--. 1 root root 3202 2010-03-21 01:31 textcaptcha.php
 
Old 03-24-2010, 07:17 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Sorry for the late reply,
Regarding logs, you should see something like the following in the log files
Quote:
x.x.x.x - - [24/Mar/2010:13:55:22 +0200] "GET /webmail/src/login.php HTTP/1.1" 200 2731
x.x.x.x - - [24/Mar/2010:13:55:22 +0200] "GET /webmail/plugins/captcha/backends/textcaptcha/image_generator.php?sq=1269431722 HTTP/1.1" 200 3865
The only thing I had to change in textcaptcha_config.php in order for textcaptcha to work was the path to x-fonts, as I have a customized xserver installation.
Quote:
$captcha_font_path = '/usr/share/X11/fonts/TTF/';
I have already told you to try a more simple backend, as textcaptcha needs some optional Pear packages in order to work.
For me captcha_php and csi worked out of the box, as the only thing they need is gd support.

Another thing to do is to change ownership to the whole plugons/captcha directory to the user/group apache runs as (I think for fedora is apache:apache):
Code:
chown -R apache:apache /usr/share/squirrelmail/plugins/captcha
Regards
 
Old 03-27-2010, 03:40 AM   #12
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Original Poster
Rep: Reputation: 17
Unhappy


Dear bathory
I understand that you really try to help me but, after doing all the thing I get the same result. I attach a screen shot.
I think these are the perfect logs which we want:
Quote:
[root@localhost plugins]# tail -f /var/log/httpd/access_log
::1 - - [21/Mar/2010:13:48:52 +0530] "GET /webmail HTTP/1.1" 301 308 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [21/Mar/2010:13:48:52 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [27/Mar/2010:19:21:18 +0530] "GET /webmail HTTP/1.1" 301 308 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
::1 - - [27/Mar/2010:19:21:18 +0530] "GET /webmail/ HTTP/1.1" 302 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091027 Fedora/3.5.4-1.fc12 Firefox/3.5.4"
Quote:
[root@localhost plugins]# tail -f /var/log/httpd/ssl_access_log
::1 - - [27/Mar/2010:19:28:24 +0530] "GET /webmail/plugins/captcha/backends/textcaptcha/image_generator.php?sq=1269698304 HTTP/1.1" 500 -
::1 - - [27/Mar/2010:19:29:47 +0530] "GET /webmail/ HTTP/1.1" 302 -
::1 - - [27/Mar/2010:19:29:47 +0530] "GET /webmail/src/login.php HTTP/1.1" 200 2793
::1 - - [27/Mar/2010:19:29:47 +0530] "GET /webmail/images/sm_logo.png HTTP/1.1" 304 -
::1 - - [27/Mar/2010:19:29:47 +0530] "GET /webmail/plugins/captcha/backends/textcaptcha/image_generator.php?sq=1269698387 HTTP/1.1" 500 -
::1 - - [27/Mar/2010:19:29:47 +0530] "GET /favicon.ico HTTP/1.1" 404 285
::1 - - [27/Mar/2010:19:30:05 +0530] "GET /webmail/ HTTP/1.1" 302 -
::1 - - [27/Mar/2010:19:30:05 +0530] "GET /webmail/src/login.php HTTP/1.1" 200 2793
::1 - - [27/Mar/2010:19:30:05 +0530] "GET /webmail/images/sm_logo.png HTTP/1.1" 304 -
::1 - - [27/Mar/2010:19:30:05 +0530] "GET /webmail/plugins/captcha/backends/textcaptcha/image_generator.php?sq=1269698405 HTTP/1.1" 500 -

Quote:
[root@localhost plugins]# tail -f /var/log/httpd/ssl_error_log
[Sat Mar 27 19:28:03 2010] [error] [client ::1] File does not exist: /var/www/html/favicon.ico
[Sat Mar 27 19:28:04 2010] [error] [client ::1] PHP Warning: require_once(Text/CAPTCHA.php): failed to open stream: No such file or directory in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:28:04 2010] [error] [client ::1] PHP Fatal error: require_once(): Failed opening required 'Text/CAPTCHA.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:28:24 2010] [error] [client ::1] PHP Warning: require_once(Text/CAPTCHA.php): failed to open stream: No such file or directory in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:28:24 2010] [error] [client ::1] PHP Fatal error: require_once(): Failed opening required 'Text/CAPTCHA.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:29:47 2010] [error] [client ::1] PHP Warning: require_once(Text/CAPTCHA.php): failed to open stream: No such file or directory in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:29:47 2010] [error] [client ::1] PHP Fatal error: require_once(): Failed opening required 'Text/CAPTCHA.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:29:47 2010] [error] [client ::1] File does not exist: /var/www/html/favicon.ico
[Sat Mar 27 19:30:05 2010] [error] [client ::1] PHP Warning: require_once(Text/CAPTCHA.php): failed to open stream: No such file or directory in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
[Sat Mar 27 19:30:05 2010] [error] [client ::1] PHP Fatal error: require_once(): Failed opening required 'Text/CAPTCHA.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/squirrelmail/plugins/captcha/backends/textcaptcha/image_generator.php on line 41, referer: https://localhost/webmail/src/login.php
Attached Thumbnails
Click image for larger version

Name:	webmail.png
Views:	52
Size:	94.2 KB
ID:	3173  
 
Old 03-27-2010, 12:52 PM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
[Sat Mar 27 19:28:24 2010] [error] [client ::1] PHP Fatal error: require_once(): Failed opening required 'Text/CAPTCHA.php'
You miss the Text_CAPTCHA pear extension. I've already told you that you need to install some extensions in order for textcaptcha to work. From config.php:
Quote:
// textcaptcha Pear Text_CAPTCHA
// See: http://pear.php.net/package/Text_CAPTCHA
// Requires Pear packages:
// Text_Password
// Text_CAPTCHA
// Optional Pear packages:
// Image_Text (highly recommended)
// Numbers_Words
// Text_Figlet
Get at least the 2 required (Text_Password, Text_CAPTCHA) and install them:
Code:
tar zxvf Text_Password-1.1.1.tgz
pear install Text_Password-1.1.1

tar zxvf Text_CAPTCHA-0.4.0.tgz
pear config-set preferred_state alpha
pear install Text_CAPTCHA-0.4.0
pear config-set preferred_state stable
If you think it's a bit complicated, why don't you try the captcha_php that needs no additional extensions to be installed.

Regards
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Using FIGlets for open source CAPTCHA with PHP LXer Syndicated Linux News 0 09-04-2008 01:40 AM
Postfix "humancheck" or captcha-like thingies. Are they existing? lorenzodarkside Linux - Server 1 06-12-2008 04:16 PM
LXer: Microsoft’s CAPTCHA successfully broken LXer Syndicated Linux News 0 06-03-2008 07:50 AM
LXer: Three ways to test Web form input with a CAPTCHA LXer Syndicated Linux News 0 04-14-2008 04:10 PM
Squirrelmail sachin0178 Linux - Newbie 4 11-23-2005 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration