soulshepard
Verified User
- Joined
- Feb 7, 2008
- Messages
- 123
Hello many hav e had the same issue,
I had the desire to set per domain different suhosin settings and finally get rid of the send mail from / return path settings on my setups.
as i use modruid2 and suhosin i unfortunatly i cannot simply add a line in custom httpd configurations to overwrite a line allready in the template
thus the reason to use a custom template with a php if exist clause.
so in /usr/local/directadmin/data/templates/custom
i added the 4 templates
virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf
for the suhosin section i add this under the docroot section
for the return-path section
so now you create two config files (in this case i placed them in the /usr/local/directadmin/data/users folder but one could also let the user configure it them self with or without a control panel wrapper)
mailfrom.conf
blacklist.conf
and dont forget to add as trusted_users the additional user
the settings
untrusted_set_sender = *
no_local_from_check
had no effect for me.. i only had to do the custom template and the trusted user..
does anyone know a way without setting the trusted user?
I had the desire to set per domain different suhosin settings and finally get rid of the send mail from / return path settings on my setups.
as i use modruid2 and suhosin i unfortunatly i cannot simply add a line in custom httpd configurations to overwrite a line allready in the template
thus the reason to use a custom template with a php if exist clause.
so in /usr/local/directadmin/data/templates/custom
i added the 4 templates
virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf
for the suhosin section i add this under the docroot section
Code:
|$/usr/local/bin/php
<?php
if(file_exists("/usr/local/directadmin/data/users/|USER|/blacklist.conf")) {
$ini_array = parse_ini_file("/usr/local/directadmin/data/users/|USER|/blacklist.conf");
if ($ini_array[blacklist])
{
echo 'php_admin_value suhosin.executor.func.blacklist "' . $ini_array[blacklist] . '"';
} } else {
echo 'php_admin_value suhosin.executor.func.blacklist "system, shell_exec, exec, passthru, php_uname, popen, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid,posix_setgid, posix_uname, proc_close, proc_nice, proc_open, proc_terminate"';
}
?>
DONE|
for the return-path section
Code:
|$/usr/local/bin/php
<?php
if(file_exists("/usr/local/directadmin/data/users/|USER|/mailfrom.conf")) {
$ini_array = parse_ini_file("/usr/local/directadmin/data/users/|USER|/mailfrom.conf");
if ($ini_array[mailfrom])
{
echo 'php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f ' . $ini_array[mailfrom] . '"';
} } else {
echo 'php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|"';
}
?>
DONE|
so now you create two config files (in this case i placed them in the /usr/local/directadmin/data/users folder but one could also let the user configure it them self with or without a control panel wrapper)
mailfrom.conf
Code:
blacklist.conf
Code:
blacklist=system, shell_exec, exec, passthru, popen, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid,posix_setgid, posix_uname, proc_close, proc_nice, proc_open, proc_terminate
and dont forget to add as trusted_users the additional user
Code:
trusted_users = (your userid of the da user)
the settings
untrusted_set_sender = *
no_local_from_check
had no effect for me.. i only had to do the custom template and the trusted user..
does anyone know a way without setting the trusted user?