[BlueOnyx:10541] Re: PHP and Webmail

Michael Stauber mstauber at blueonyx.it
Fri May 11 07:22:03 -05 2012


Hi Bill,

> Is there way to allow domains access to webmail without enabling php for
> the  domain on BO 5106? If they do not have php enabled and the you go to
> www.example.com/webmail they see the webmail source. So you have to enable
> it but then they could, if they have ftp access, use php on their site,
> even if you do not want them to.

You could throw a .htaccess into the directory of the Webmail program with 
this in it:

AddType application/x-httpd-php .php5
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php

But only do so if there is NO site on the server using suPHP.

The more elegant way that allows more flexibility would be to edit the 
/etc/httpd/conf/vhosts/siteX.include file of each Vsite that needs Webmail, 
but has PHP off.

In there add the following:

<Directory /path/to/webmail/>
AddType application/x-httpd-php .php5
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
php_admin_flag safe_mode On
php_admin_flag safe_mode_gid Off
php_admin_value safe_mode_allowed_env_vars 
PHP_,_HTTP_HOST,_SCRIPT_NAME,_SCRIPT_FILENAME,_DOCUMENT_ROOT,_REMOTE_ADDR,_SOWNER
php_admin_value safe_mode_exec_dir .
php_admin_value safe_mode_include_dir /usr/sausalito/configs/php/
php_admin_value safe_mode_protected_env_vars LD_LIBRARY_PATH
php_admin_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include Off
php_admin_value open_basedir 
/var/www/html/:/var/lib/php/session/:/usr/sausalito/configs/php/:/tmp/:/path/to/webmail/
php_admin_value post_max_size 8M
php_admin_value upload_max_filesize 2M
php_admin_value max_execution_time 30
php_admin_value max_input_time 60
php_admin_value memory_limit 16M
php_admin_flag mail.add_x_header On
php_admin_value sendmail_path /usr/sausalito/sbin/phpsendmail
php_admin_value auto_prepend_file 
/usr/sausalito/configs/php/set_php_headers.php
</Directory>

Beware of the line wraps that happened in this email. There is stuff that the 
email client will wrap into two lines, although it's just a long line.

Also: Change all /path/to/webmail/ instances to the path where your webmail is 
located. This is the full path to the directory of the webmail program.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list