Webmail and Squirrlemail not working

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
428
Hi there,

I get permission errors, and the odd thing is, both are (at least so it seems) correct.

I got apache:apache and 700 for

For squirrlemail:
/var/www/html/squirrelmail-1.4.4-rc1 # ll
total 176
-rwxr-xr-x 1 root root 6363 Nov 7 20:54 AUTHORS
-rwxr-xr-x 1 root root 51426 Jan 1 06:11 ChangeLog
drwxr-xr-x 5 root root 4096 Feb 16 17:23 class
drwxr-xr-x 2 root root 4096 Feb 16 17:23 config
-rwxr-xr-x 1 root root 92 Dec 26 2001 configure
drwxr-xr-x 3 root root 4096 Jan 1 06:15 contrib
-rwxr-xr-x 1 root root 15131 Dec 16 1999 COPYING
drwx------ 2 apache apache 4096 Feb 16 17:23 data
drwxr-xr-x 3 root root 4096 Feb 16 17:23 doc
drwxr-xr-x 4 root root 4096 Feb 16 17:23 functions
drwxr-xr-x 3 root root 4096 Feb 16 17:23 help
drwxr-xr-x 2 root root 4096 Feb 16 17:23 images
drwxr-xr-x 3 root root 4096 Feb 16 17:23 include
-rwxr-xr-x 1 root root 338 Dec 27 17:03 index.php
-rwxr-xr-x 1 root root 8354 Dec 28 14:30 INSTALL
drwxr-xr-x 2 root root 4096 Feb 16 17:23 locale
drwxr-xr-x 18 root root 4096 Feb 16 17:23 plugins
drwxr-xr-x 2 root root 4096 Feb 16 17:23 po
-rwxr-xr-x 1 root root 2637 Jun 27 2004 README
-rwxr-xr-x 1 root root 4470 Dec 28 15:57 ReleaseNotes
drwxr-xr-x 2 root root 4096 Feb 16 17:23 src
drwxr-xr-x 3 root root 4096 Feb 16 17:23 themes
-rwxr-xr-x 1 root root 4657 Dec 28 14:30 UPGRADE




/var/www/html/squirrelmail-1.4.4-rc1/data # ll
total 8
-rwx------ 1 apache apache 48 Jul 27 2003 default_pref
-rwx------ 1 apache apache 474 Dec 30 01:19 index.php



And for Webmail: UebiMiau

/var/www/html/webmail # ll
total 172
-rwxr-xr-x 1 root root 6059 Sep 25 2002 addressbook.php
-rwxr-xr-x 1 root root 902 Sep 3 2002 badlogin.php
-rwxr-xr-x 1 root root 2315 Sep 3 2002 catch.php
-rwxr-xr-x 1 root root 8374 Oct 10 2002 CHANGELOG.txt
-rwxr-xr-x 1 root root 1710 Sep 23 2002 download.php
-rwxr-xr-x 1 root root 1074 Sep 3 2002 error.php
drwxr-xr-x 2 root root 4096 Feb 16 17:22 extra
-rwxr-xr-x 1 root root 5838 Sep 25 2002 folders.php
-rwxr-xr-x 1 root root 777 Sep 3 2002 headers.php
drwxr-xr-x 2 root root 4096 Feb 16 17:22 images
drwxr-xr-x 2 root root 4096 Feb 16 17:22 inc
-rwxr-xr-x 1 root root 3791 Sep 23 2002 index.php
-rwxr-xr-x 1 root root 723 Sep 9 2002 INSTALL.txt
drwxr-xr-x 2 root root 4096 Feb 16 17:22 langs
-rwxr-xr-x 1 root root 2118 Sep 18 2002 logout.php
-rwxr-xr-x 1 root root 12307 Oct 1 2002 msglist.php
-rwxr-xr-x 1 root root 18564 Jun 5 2003 newmsg.php
-rwxr-xr-x 1 root root 4582 Sep 25 2002 preferences.php
-rwxr-xr-x 1 root root 3411 Oct 1 2002 printmsg.php
-rwxr-xr-x 1 root root 1082 Sep 3 2002 quick_address.php
-rwxr-xr-x 1 root root 1693 Sep 20 2002 README.txt
-rwxr-xr-x 1 root root 9261 Oct 1 2002 readmsg.php
-rwxr-xr-x 1 root root 6959 Sep 27 2002 search.php
-rwxr-xr-x 1 root root 850 Sep 3 2002 show_body.php
drwxr-xr-x 2 root root 4096 Feb 16 17:22 smarty
drwxr-xr-x 4 root root 4096 Feb 16 17:22 themes
drwx------ 2 apache apache 4096 Feb 16 17:22 tmp
-rwxr-xr-x 1 root root 1913 Sep 23 2002 upload.php

The errors are:

For Squirrlemail:

SquirrelMail version 1.4.4-rc1
By the SquirrelMail Development Team
ERROR
Error opening ../data/default_pref
Default preference file not found or not readable!
Please contact your system administrator and report this error.

and for the


Webmail: UebiMiau
Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /var/www/html/webmail/tmp owned by uid 100 in /var/www/html/webmail/smarty/Smarty.class.php on line 1412

Warning: Smarty error: problem creating directory "./tmp//_cached_templates/neotech.net" in /var/www/html/webmail/smarty/Smarty.class.php on line 1543

Warning: Smarty error: problem writing './tmp//_cached_templates/neotech.net/login.php.' in /var/www/html/webmail/smarty/Smarty.class.php on line 1543

Warning: fetch(): Unable to access ./tmp//_cached_templates/neotech.net/login.php in /var/www/html/webmail/smarty/Smarty.class.php on line 633

Warning: fetch(./tmp//_cached_templates/neotech.net/login.php): failed to open stream: No such file or directory in /var/www/html/webmail/smarty/Smarty.class.php on line 633

Warning: fetch(): Unable to access ./tmp//_cached_templates/neotech.net/login.php in /var/www/html/webmail/smarty/Smarty.class.php on line 633

Warning: fetch(./tmp//_cached_templates/neotech.net/login.php): failed to open stream: No such file or directory in /var/www/html/webmail/smarty/Smarty.class.php on line 633

Warning: fetch(): Failed opening './tmp//_cached_templates/neotech.net/login.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/webmail/smarty/Smarty.class.php on line 633

Using WBEL

-Alon
 
I haven't played with safe_mode recently, but it looks like php is comparing the UID of the script against the UID of the file it wants to work on.

From the php manual:

When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function or its directory.

For squirrelmail, for example, the function that opens default_pref is a script in the functions directory, I believe, which is likely owned by root. However, your data directory (and default_pref) is owned by apache. safe_mode won't let the root-owned script work on the apache-owned file.

safe_mode restrictions are tricky...
 
Yup,... had to disable the Master safe_mode in php.ini to make it happen.
That fixed both Webmail interfaces.

Thanks,

-Alon.
 
I have my own sollution. Keep safe_mode on global setting =on and change permission for
/var/www/html/webmail/tmp/

chown -R root:apache /var/www/html/webmail/tmp/
chmod -R 770 root:apache /var/www/html/webmail/tmp/

I hope it will help you.
 
Back
Top