From: Bu X. <bus...@gm...> - 2013-06-04 11:35:23
|
Hi all, I want to use the server_side_filters plugin to do the procmail filter in the server side. version list: squirrelmail-webmail-1.4.22 server_settings_backend-2.0-1.4.0.tar.gz server_side_filters-2.0beta1-1.4.0.tar.gz compatibility-2.0.16-1.0.tar.gz And I have enabled the server_side_filters throw config/conf.pl script. Plugins Installed Plugins 1. server_side_filters Available Plugins: 2. administrator When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" And in my /var/log/httpd/ssl_error_log: PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php Here is the global.php function: 275 function sq_call_function_suppress_errors($function, $args=array()) { 276 $display_errors = ini_get('display_errors'); 277 ini_set('display_errors', '0'); 278 $ret = call_user_func_array($function, $args); 279 ini_set('display_errors', $display_errors); 280 return $ret; 281 } Anyone can give me some advice? Thanks, Bu Xiaobing |
From: Paul L. <pa...@sq...> - 2013-06-04 16:49:09
|
On Tue, Jun 4, 2013 at 4:35 AM, Bu Xiaobing <bus...@gm...> wrote: > Hi all, > > I want to use the server_side_filters plugin to do the procmail filter in the server side. > > version list: > squirrelmail-webmail-1.4.22 > server_settings_backend-2.0-1.4.0.tar.gz > server_side_filters-2.0beta1-1.4.0.tar.gz > compatibility-2.0.16-1.0.tar.gz > > And I have enabled the server_side_filters throw config/conf.pl script. You need to show configuration files/snippets. > Plugins > Installed Plugins > 1. server_side_filters > > Available Plugins: > 2. administrator > > > When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" > > And in my /var/log/httpd/ssl_error_log: > > PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php This is a warning, not an error. You should provide the complete log information for whatever has happened. You may need to look in a different log file or increase your PHP log settings. You also might try using only ASCII characters in your filters to start with. > Here is the global.php function: > > 275 function sq_call_function_suppress_errors($function, $args=array()) { > 276 $display_errors = ini_get('display_errors'); > 277 ini_set('display_errors', '0'); > 278 $ret = call_user_func_array($function, $args); > 279 ini_set('display_errors', $display_errors); > 280 return $ret; > 281 } > Anyone can give me some advice? -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-06 03:20:32
|
On 2013-6-5 0:48, Paul Lesniewski wrote: > On Tue, Jun 4, 2013 at 4:35 AM, Bu Xiaobing <bus...@gm...> wrote: >> Hi all, >> >> I want to use the server_side_filters plugin to do the procmail filter in the server side. >> >> version list: >> squirrelmail-webmail-1.4.22 >> server_settings_backend-2.0-1.4.0.tar.gz >> server_side_filters-2.0beta1-1.4.0.tar.gz >> compatibility-2.0.16-1.0.tar.gz >> >> And I have enabled the server_side_filters throw config/conf.pl script. > > You need to show configuration files/snippets. > >> Plugins >> Installed Plugins >> 1. server_side_filters >> >> Available Plugins: >> 2. administrator >> >> >> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >> >> And in my /var/log/httpd/ssl_error_log: >> >> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php > > This is a warning, not an error. You should provide the complete log > information for whatever has happened. You may need to look in a > different log file or increase your PHP log settings. You also might > try using only ASCII characters in your filters to start with. > >> Here is the global.php function: >> >> 275 function sq_call_function_suppress_errors($function, $args=array()) { >> 276 $display_errors = ini_get('display_errors'); >> 277 ini_set('display_errors', '0'); >> 278 $ret = call_user_func_array($function, $args); >> 279 ini_set('display_errors', $display_errors); >> 280 return $ret; >> 281 } >> Anyone can give me some advice? > I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: server_side_filters_procmail/config.php $use_maildirs = 0; $filter_rules_storage_info = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'PHP'), 'FILE' => array('VALUE_REPLACE' => '/tmp/%u/.mailfilter'), 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), ); When add one filter rule and click SAVE, it said "ERROR:Could not write to file "/" " Here is the ssl_error_log I have config the log level as http://www.squirrelmail.org/docs/admin/admin-12.html#errormessages said. [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: file_put_contents(/): failed to open stream: Is a directory in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php Are there some configuration guide? or some examples? My purpose is to use plugins to configure /home/%u/.procmailrc file as procmail command do. |
From: Paul L. <pa...@sq...> - 2013-06-07 19:36:10
|
On Wed, Jun 5, 2013 at 8:20 PM, Bu Xiaobing <bus...@gm...> wrote: > On 2013-6-5 0:48, Paul Lesniewski wrote: >> On Tue, Jun 4, 2013 at 4:35 AM, Bu Xiaobing <bus...@gm...> wrote: >>> Hi all, >>> >>> I want to use the server_side_filters plugin to do the procmail filter in the server side. >>> >>> version list: >>> squirrelmail-webmail-1.4.22 >>> server_settings_backend-2.0-1.4.0.tar.gz >>> server_side_filters-2.0beta1-1.4.0.tar.gz >>> compatibility-2.0.16-1.0.tar.gz >>> >>> And I have enabled the server_side_filters throw config/conf.pl script. >> >> You need to show configuration files/snippets. >> >>> Plugins >>> Installed Plugins >>> 1. server_side_filters >>> >>> Available Plugins: >>> 2. administrator >>> >>> >>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>> >>> And in my /var/log/httpd/ssl_error_log: >>> >>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >> >> This is a warning, not an error. You should provide the complete log >> information for whatever has happened. You may need to look in a >> different log file or increase your PHP log settings. You also might >> try using only ASCII characters in your filters to start with. >> >>> Here is the global.php function: >>> >>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>> 276 $display_errors = ini_get('display_errors'); >>> 277 ini_set('display_errors', '0'); >>> 278 $ret = call_user_func_array($function, $args); >>> 279 ini_set('display_errors', $display_errors); >>> 280 return $ret; >>> 281 } >>> Anyone can give me some advice? > > I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: > > server_side_filters_procmail/config.php > $use_maildirs = 0; Your system uses mbox? > $filter_rules_storage_info = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'PHP'), Per the documentation, if you are using PHP to access users' files in their home directories, does the web server really have write access to those files/directories? > 'FILE' => array('VALUE_REPLACE' => '/tmp/%u/.mailfilter'), Presumably this is for testing, because it isn't matching what your requirements are per below. What version of Server Settings Backend are you using? Presumably, version 2.0. The example configuration in the filters plugin is out of sync. Please change %u to %1 and see what you get. (Note in the future, if you upgrade Server Settings Backend, you will need to come back to this and change it to %u again.) > 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), > 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > ); > > When add one filter rule and click SAVE, it said "ERROR:Could not write to file "/" " > Here is the ssl_error_log I have config the log level as http://www.squirrelmail.org/docs/admin/admin-12.html#errormessages said. > > [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php > [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php This is a minor issue you have discovered because your $default_folder_prefix (in the main SM config.php) is presumably empty. I have a fix for that, but this isn't going to matter to you (code will still execute the same). > [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: file_put_contents(/): failed to open stream: Is a directory in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php This appears to be the main problem. See above for the fix. > Are there some configuration guide? or some examples? My purpose is to use plugins to configure /home/%u/.procmailrc file as procmail command do. As is mentioned several times in the documentation and configuration files, there is ample documentation and information in the Server Settings Backend plugin. More general examples for configuring it can also be found in the Server Settings plugin. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-14 02:29:20
|
On 2013-6-8 3:35, Paul Lesniewski wrote: > On Wed, Jun 5, 2013 at 8:20 PM, Bu Xiaobing <bus...@gm...> wrote: >> On 2013-6-5 0:48, Paul Lesniewski wrote: >>> On Tue, Jun 4, 2013 at 4:35 AM, Bu Xiaobing <bus...@gm...> wrote: >>>> Hi all, >>>> >>>> I want to use the server_side_filters plugin to do the procmail filter in the server side. >>>> >>>> version list: >>>> squirrelmail-webmail-1.4.22 >>>> server_settings_backend-2.0-1.4.0.tar.gz >>>> server_side_filters-2.0beta1-1.4.0.tar.gz >>>> compatibility-2.0.16-1.0.tar.gz >>>> >>>> And I have enabled the server_side_filters throw config/conf.pl script. >>> You need to show configuration files/snippets. >>> >>>> Plugins >>>> Installed Plugins >>>> 1. server_side_filters >>>> >>>> Available Plugins: >>>> 2. administrator >>>> >>>> >>>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>>> >>>> And in my /var/log/httpd/ssl_error_log: >>>> >>>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >>> This is a warning, not an error. You should provide the complete log >>> information for whatever has happened. You may need to look in a >>> different log file or increase your PHP log settings. You also might >>> try using only ASCII characters in your filters to start with. >>> >>>> Here is the global.php function: >>>> >>>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>>> 276 $display_errors = ini_get('display_errors'); >>>> 277 ini_set('display_errors', '0'); >>>> 278 $ret = call_user_func_array($function, $args); >>>> 279 ini_set('display_errors', $display_errors); >>>> 280 return $ret; >>>> 281 } >>>> Anyone can give me some advice? >> I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: >> >> server_side_filters_procmail/config.php >> $use_maildirs = 0; > Your system uses mbox? > >> $filter_rules_storage_info = array( >> 'BACKEND' => 'local_file', >> 'ACCESS_TYPE' => array('VALUE' => 'PHP'), > Per the documentation, if you are using PHP to access users' files in > their home directories, does the web server really have write access > to those files/directories? > >> 'FILE' => array('VALUE_REPLACE' => '/tmp/%u/.mailfilter'), > Presumably this is for testing, because it isn't matching what your > requirements are per below. What version of Server Settings Backend > are you using? Presumably, version 2.0. The example configuration in > the filters plugin is out of sync. Please change %u to %1 and see > what you get. (Note in the future, if you upgrade Server Settings > Backend, you will need to come back to this and change it to %u > again.) > >> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), >> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >> ); >> >> When add one filter rule and click SAVE, it said "ERROR:Could not write to file "/" " >> Here is the ssl_error_log I have config the log level as http://www.squirrelmail.org/docs/admin/admin-12.html#errormessages said. >> >> [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >> [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php > This is a minor issue you have discovered because your > $default_folder_prefix (in the main SM config.php) is presumably > empty. I have a fix for that, but this isn't going to matter to you > (code will still execute the same). > >> [Thu Jun 06 10:57:50 2013] [error] [client 192.168.66.6] PHP Warning: file_put_contents(/): failed to open stream: Is a directory in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php > This appears to be the main problem. See above for the fix. > >> Are there some configuration guide? or some examples? My purpose is to use plugins to configure /home/%u/.procmailrc file as procmail command do. > As is mentioned several times in the documentation and configuration > files, there is ample documentation and information in the Server > Settings Backend plugin. More general examples for configuring it can > also be found in the Server Settings plugin. > Hi, Paul Yes, I use mbox. And for test purpose, I have changed the config as blow: $filter_rules_storage_info = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'PHP'), 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), ); Of course php owner have write privilege to the /tmp directory. But seems the same problem. Following is the debug file information: -- SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: Array ( [0] => Array ( [0] => Array ( [0] => [1] => 0 ) ) [1] => Array ( [0] => Array ( [0] => [1] => 0 ) ) ) CHOSEN PATTERN GROUP (1) IS: Array ( [0] => Array ( [0] => [1] => 0 ) ) Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255 Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257 SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: Array ( [0] => Array ( [0] => Array ( [0] => [1] => 0 ) ) [1] => Array ( [0] => Array ( [0] => [1] => 0 ) ) ) CHOSEN PATTERN GROUP (1) IS: Array ( [0] => Array ( [0] => [1] => 0 ) ) ERROR: Could not write to file "/" -- here is the ssl_error_log [Fri Jun 14 10:25:27 2013] [error] [client 192.168.66.6] PHP Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php [Fri Jun 14 10:25:27 2013] [error] [client 192.168.66.6] PHP Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php [Fri Jun 14 10:25:27 2013] [error] [client 192.168.66.6] PHP Warning: file_put_contents(/): failed to open stream: Is a directory in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php |
From: Paul L. <pa...@sq...> - 2013-06-19 05:36:17
|
Sorry for the delay. >>>>> version list: >>>>> squirrelmail-webmail-1.4.22 >>>>> server_settings_backend-2.0-1.4.0.tar.gz >>>>> server_side_filters-2.0beta1-1.4.0.tar.gz >>>>> compatibility-2.0.16-1.0.tar.gz >>>>> >>>>> And I have enabled the server_side_filters throw config/conf.pl script. >>>> You need to show configuration files/snippets. >>>> >>>>> Plugins >>>>> Installed Plugins >>>>> 1. server_side_filters >>>>> >>>>> Available Plugins: >>>>> 2. administrator >>>>> >>>>> >>>>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>>>> >>>>> And in my /var/log/httpd/ssl_error_log: >>>>> >>>>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >>>> This is a warning, not an error. You should provide the complete log >>>> information for whatever has happened. You may need to look in a >>>> different log file or increase your PHP log settings. You also might >>>> try using only ASCII characters in your filters to start with. >>>> >>>>> Here is the global.php function: >>>>> >>>>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>>>> 276 $display_errors = ini_get('display_errors'); >>>>> 277 ini_set('display_errors', '0'); >>>>> 278 $ret = call_user_func_array($function, $args); >>>>> 279 ini_set('display_errors', $display_errors); >>>>> 280 return $ret; >>>>> 281 } >>>>> Anyone can give me some advice? >>> I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: >>> >>> server_side_filters_procmail/config.php >>> $use_maildirs = 0; > > And for test purpose, I have changed the config as blow: > $filter_rules_storage_info = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'PHP'), > 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), > 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), Sorry, this %n also should be changed to %1. > 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > ); > > Of course php owner have write privilege to the /tmp directory. > > But seems the same problem. > > Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255 Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257 SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: Again, this is not the cause of your problem, but you can remove this error by adding this BEFORE line 254 in server_side_filters_procmail/functions.php: if (!empty($default_folder_prefix)) { and then you have to add a closing brace after the following two if statements - line 260 should do it. > ERROR: > Could not write to file "/" Sorry again, the problem is another oversight of version differences in the configuration file. > 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), For you needs to be "VALUE" (without the "_REPLACE" part). Remember to also use %1 instead of %n in NEW_SETTING_TEMPLATE and %1 and %2 instead of %u and %d respectively in FILE as well. A new version of the backend plugin will be out in the medium term where you will need to revert these changes back to what you originally found in the filters plugin examples. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-22 18:51:54
|
On 2013-6-19 13:35, Paul Lesniewski wrote: > Sorry for the delay. > >>>>>> version list: >>>>>> squirrelmail-webmail-1.4.22 >>>>>> server_settings_backend-2.0-1.4.0.tar.gz >>>>>> server_side_filters-2.0beta1-1.4.0.tar.gz >>>>>> compatibility-2.0.16-1.0.tar.gz >>>>>> >>>>>> And I have enabled the server_side_filters throw config/conf.pl script. >>>>> You need to show configuration files/snippets. >>>>> >>>>>> Plugins >>>>>> Installed Plugins >>>>>> 1. server_side_filters >>>>>> >>>>>> Available Plugins: >>>>>> 2. administrator >>>>>> >>>>>> >>>>>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>>>>> >>>>>> And in my /var/log/httpd/ssl_error_log: >>>>>> >>>>>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >>>>> This is a warning, not an error. You should provide the complete log >>>>> information for whatever has happened. You may need to look in a >>>>> different log file or increase your PHP log settings. You also might >>>>> try using only ASCII characters in your filters to start with. >>>>> >>>>>> Here is the global.php function: >>>>>> >>>>>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>>>>> 276 $display_errors = ini_get('display_errors'); >>>>>> 277 ini_set('display_errors', '0'); >>>>>> 278 $ret = call_user_func_array($function, $args); >>>>>> 279 ini_set('display_errors', $display_errors); >>>>>> 280 return $ret; >>>>>> 281 } >>>>>> Anyone can give me some advice? >>>> I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: >>>> >>>> server_side_filters_procmail/config.php >>>> $use_maildirs = 0; >> >> And for test purpose, I have changed the config as blow: >> $filter_rules_storage_info = array( >> 'BACKEND' => 'local_file', >> 'ACCESS_TYPE' => array('VALUE' => 'PHP'), >> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), >> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), > > Sorry, this %n also should be changed to %1. > >> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >> ); >> >> Of course php owner have write privilege to the /tmp directory. >> >> But seems the same problem. >> >> Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255 Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257 SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: > > Again, this is not the cause of your problem, but you can remove this > error by adding this BEFORE line 254 in > server_side_filters_procmail/functions.php: > > if (!empty($default_folder_prefix)) { > > and then you have to add a closing brace after the following two if > statements - line 260 should do it. > >> ERROR: >> Could not write to file "/" > > Sorry again, the problem is another oversight of version differences > in the configuration file. > >> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), > > For you needs to be "VALUE" (without the "_REPLACE" part). Remember > to also use %1 instead of %n in NEW_SETTING_TEMPLATE and %1 and %2 > instead of %u and %d respectively in FILE as well. A new version of > the backend plugin will be out in the medium term where you will need > to revert these changes back to what you originally found in the > filters plugin examples. > Thanks for your relies, I configured the config.php as follows, $filter_rules_storage_info = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'PHP'), 'FILE' => array('VALUE' => '/tmp/.mailfilter'), 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), ); And then the filter rules add by the webmail GUI will be saved as the assigned file. [root@mailtest server_side_filters]# cat /tmp/.mailfilter ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## # ####RULE#### From-''-test-''-Trash-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- :0H: * ^From: .*test $DEFAULT/Trash # ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES ########## ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## For security reason, I choose to save the .mailfiter into each users' home directory as /home/%1/.mailfilter, but the apache running user don't or shouldn't have the privileges to do that work. And I found SUID can do this, I configured the SUID method as follows: $filter_rules_storage_info = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'SUID'), 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), 'FILE' => array('VALUE_REPLACE' => '/home/%1/.mailfiter'), 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), ); I create some filter rules, after a click SAVE button, some error appeared, "There was a problem creating this filter Unable to save filter rules" And in the /var/log/httpd/error_log I can find the following errors "setgroups(0, NULL): Operation not permitted" Any one can give me some advices to save this problem? Thanks, Bu Xiaobing |
From: Paul L. <pa...@sq...> - 2013-06-23 17:40:46
|
On Sat, Jun 22, 2013 at 11:52 AM, Bu Xiaobing <bus...@gm...> wrote: > On 2013-6-19 13:35, Paul Lesniewski wrote: >> Sorry for the delay. >> >>>>>>> version list: >>>>>>> squirrelmail-webmail-1.4.22 >>>>>>> server_settings_backend-2.0-1.4.0.tar.gz >>>>>>> server_side_filters-2.0beta1-1.4.0.tar.gz >>>>>>> compatibility-2.0.16-1.0.tar.gz >>>>>>> >>>>>>> And I have enabled the server_side_filters throw config/conf.pl script. >>>>>> You need to show configuration files/snippets. >>>>>> >>>>>>> Plugins >>>>>>> Installed Plugins >>>>>>> 1. server_side_filters >>>>>>> >>>>>>> Available Plugins: >>>>>>> 2. administrator >>>>>>> >>>>>>> >>>>>>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>>>>>> >>>>>>> And in my /var/log/httpd/ssl_error_log: >>>>>>> >>>>>>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >>>>>> This is a warning, not an error. You should provide the complete log >>>>>> information for whatever has happened. You may need to look in a >>>>>> different log file or increase your PHP log settings. You also might >>>>>> try using only ASCII characters in your filters to start with. >>>>>> >>>>>>> Here is the global.php function: >>>>>>> >>>>>>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>>>>>> 276 $display_errors = ini_get('display_errors'); >>>>>>> 277 ini_set('display_errors', '0'); >>>>>>> 278 $ret = call_user_func_array($function, $args); >>>>>>> 279 ini_set('display_errors', $display_errors); >>>>>>> 280 return $ret; >>>>>>> 281 } >>>>>>> Anyone can give me some advice? >>>>> I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: >>>>> >>>>> server_side_filters_procmail/config.php >>>>> $use_maildirs = 0; >>> >>> And for test purpose, I have changed the config as blow: >>> $filter_rules_storage_info = array( >>> 'BACKEND' => 'local_file', >>> 'ACCESS_TYPE' => array('VALUE' => 'PHP'), >>> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), >>> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >>> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >>> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), >> >> Sorry, this %n also should be changed to %1. >> >>> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >>> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >>> ); >>> >>> Of course php owner have write privilege to the /tmp directory. >>> >>> But seems the same problem. >>> >>> Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255 Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257 SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: >> >> Again, this is not the cause of your problem, but you can remove this >> error by adding this BEFORE line 254 in >> server_side_filters_procmail/functions.php: >> >> if (!empty($default_folder_prefix)) { >> >> and then you have to add a closing brace after the following two if >> statements - line 260 should do it. >> >>> ERROR: >>> Could not write to file "/" >> >> Sorry again, the problem is another oversight of version differences >> in the configuration file. >> >>> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), >> >> For you needs to be "VALUE" (without the "_REPLACE" part). Remember >> to also use %1 instead of %n in NEW_SETTING_TEMPLATE and %1 and %2 >> instead of %u and %d respectively in FILE as well. A new version of >> the backend plugin will be out in the medium term where you will need >> to revert these changes back to what you originally found in the >> filters plugin examples. >> > > Thanks for your relies, I configured the config.php as follows, > $filter_rules_storage_info = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'PHP'), > 'FILE' => array('VALUE' => '/tmp/.mailfilter'), > 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), > 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > ); > > And then the filter rules add by the webmail GUI will be saved as the assigned file. > > [root@mailtest server_side_filters]# cat /tmp/.mailfilter > ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## > ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## > # > ####RULE#### From-''-test-''-Trash-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- > :0H: > * ^From: .*test > $DEFAULT/Trash > > > # > ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES ########## > ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## > > For security reason, I choose to save the .mailfiter into each users' home directory as /home/%1/.mailfilter, but the apache running user don't or shouldn't have the privileges to do that work. > > And I found SUID can do this, I configured the SUID method as follows: > > $filter_rules_storage_info = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'SUID'), > 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), > 'FILE' => array('VALUE_REPLACE' => '/home/%1/.mailfiter'), VALUE instead of VALUE_REPLACE > 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), > 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > ); > > I create some filter rules, after a click SAVE button, some error appeared, "There was a problem creating this filter Unable to save filter rules" > > And in the /var/log/httpd/error_log I can find the following errors "setgroups(0, NULL): Operation not permitted" > > Any one can give me some advices to save this problem? > > Thanks, > Bu Xiaobing > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > ----- > squirrelmail-plugins mailing list > Posting guidelines: http://squirrelmail.org/postingguidelines > List address: squ...@li... > List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins > List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-24 03:00:04
|
On 2013-6-24 1:40, Paul Lesniewski wrote: > On Sat, Jun 22, 2013 at 11:52 AM, Bu Xiaobing <bus...@gm...> wrote: >> On 2013-6-19 13:35, Paul Lesniewski wrote: >>> Sorry for the delay. >>> >>>>>>>> version list: >>>>>>>> squirrelmail-webmail-1.4.22 >>>>>>>> server_settings_backend-2.0-1.4.0.tar.gz >>>>>>>> server_side_filters-2.0beta1-1.4.0.tar.gz >>>>>>>> compatibility-2.0.16-1.0.tar.gz >>>>>>>> >>>>>>>> And I have enabled the server_side_filters throw config/conf.pl script. >>>>>>> You need to show configuration files/snippets. >>>>>>> >>>>>>>> Plugins >>>>>>>> Installed Plugins >>>>>>>> 1. server_side_filters >>>>>>>> >>>>>>>> Available Plugins: >>>>>>>> 2. administrator >>>>>>>> >>>>>>>> >>>>>>>> When I use "Options" -> "Message Filters" in my web browser, after add some filter rules, and click the SAVE button, it says "Error: Error deleting file or directory" >>>>>>>> >>>>>>>> And in my /var/log/httpd/ssl_error_log: >>>>>>>> >>>>>>>> PHP Warning: unlink(/): \xca\xc7\xd2\xbb\xb8\xf6\xc4\xbf\xc2\xbc in /var/www/html/webmail/functions/global.php on line 278, referer: https://mymailserver.com/webmail/plugins/server_side_filters/options.php >>>>>>> This is a warning, not an error. You should provide the complete log >>>>>>> information for whatever has happened. You may need to look in a >>>>>>> different log file or increase your PHP log settings. You also might >>>>>>> try using only ASCII characters in your filters to start with. >>>>>>> >>>>>>>> Here is the global.php function: >>>>>>>> >>>>>>>> 275 function sq_call_function_suppress_errors($function, $args=array()) { >>>>>>>> 276 $display_errors = ini_get('display_errors'); >>>>>>>> 277 ini_set('display_errors', '0'); >>>>>>>> 278 $ret = call_user_func_array($function, $args); >>>>>>>> 279 ini_set('display_errors', $display_errors); >>>>>>>> 280 return $ret; >>>>>>>> 281 } >>>>>>>> Anyone can give me some advice? >>>>>> I have enabled another plugin: server_side_filters_procmail, and below lists all the parameters I changed: >>>>>> >>>>>> server_side_filters_procmail/config.php >>>>>> $use_maildirs = 0; >>>> >>>> And for test purpose, I have changed the config as blow: >>>> $filter_rules_storage_info = array( >>>> 'BACKEND' => 'local_file', >>>> 'ACCESS_TYPE' => array('VALUE' => 'PHP'), >>>> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), >>>> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >>>> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >>>> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%n'), >>> >>> Sorry, this %n also should be changed to %1. >>> >>>> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >>>> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >>>> ); >>>> >>>> Of course php owner have write privilege to the /tmp directory. >>>> >>>> But seems the same problem. >>>> >>>> Notice: Uninitialized string offset: -1 in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 255 Warning: strpos(): Empty delimiter in /var/www/html/webmail/plugins/server_side_filters_procmail/functions.php on line 257 SERVER SETTINGS BACKEND MATCHES (PATTERN = "/^(.*)$/s") ARE: >>> >>> Again, this is not the cause of your problem, but you can remove this >>> error by adding this BEFORE line 254 in >>> server_side_filters_procmail/functions.php: >>> >>> if (!empty($default_folder_prefix)) { >>> >>> and then you have to add a closing brace after the following two if >>> statements - line 260 should do it. >>> >>>> ERROR: >>>> Could not write to file "/" >>> >>> Sorry again, the problem is another oversight of version differences >>> in the configuration file. >>> >>>> 'FILE' => array('VALUE_REPLACE' => '/tmp/.mailfilter'), >>> >>> For you needs to be "VALUE" (without the "_REPLACE" part). Remember >>> to also use %1 instead of %n in NEW_SETTING_TEMPLATE and %1 and %2 >>> instead of %u and %d respectively in FILE as well. A new version of >>> the backend plugin will be out in the medium term where you will need >>> to revert these changes back to what you originally found in the >>> filters plugin examples. >>> >> >> Thanks for your relies, I configured the config.php as follows, >> $filter_rules_storage_info = array( >> 'BACKEND' => 'local_file', >> 'ACCESS_TYPE' => array('VALUE' => 'PHP'), >> 'FILE' => array('VALUE' => '/tmp/.mailfilter'), >> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), >> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >> ); >> >> And then the filter rules add by the webmail GUI will be saved as the assigned file. >> >> [root@mailtest server_side_filters]# cat /tmp/.mailfilter >> ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## >> ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## >> # >> ####RULE#### From-''-test-''-Trash-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- >> :0H: >> * ^From: .*test >> $DEFAULT/Trash >> >> >> # >> ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES ########## >> ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## >> >> For security reason, I choose to save the .mailfiter into each users' home directory as /home/%1/.mailfilter, but the apache running user don't or shouldn't have the privileges to do that work. >> >> And I found SUID can do this, I configured the SUID method as follows: >> >> $filter_rules_storage_info = array( >> 'BACKEND' => 'local_file', >> 'ACCESS_TYPE' => array('VALUE' => 'SUID'), >> 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >> 'FILE' => array('VALUE_REPLACE' => '/home/%1/.mailfiter'), > > VALUE instead of VALUE_REPLACE > >> 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), >> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >> 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), >> 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), >> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >> ); >> >> I create some filter rules, after a click SAVE button, some error appeared, "There was a problem creating this filter Unable to save filter rules" >> >> And in the /var/log/httpd/error_log I can find the following errors "setgroups(0, NULL): Operation not permitted" >> >> Any one can give me some advices to save this problem? >> >> Thanks, >> Bu Xiaobing >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> ----- >> squirrelmail-plugins mailing list >> Posting guidelines: http://squirrelmail.org/postingguidelines >> List address: squ...@li... >> List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins >> List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins > > > I think the problem with setgroups(0, NULL): Operation not permitted has been resolved. At the first time I set 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), I find in the /var/www/html/webmail/plugins/server_settings_backend also has a squirrelmail_server_settings_suid_backend, and the file permission is -rwsr-xr-x. So I change the SUID_LOCATION value to /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend But get another error "Remote file name cannot contain "/"" in the /var/log/httpd/error_log. And if I set "$ssf_debug_server_settings_backend = 1" in the server_side_filters/config.php, and after I click "Options->Message Filters" on the web browser, the web page only display the following message: Unable to retrieve file from command "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" Can't understand why will it retrieve the /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and this file is not exist. Bu Xiaobing |
From: Paul L. <pa...@sq...> - 2013-06-24 23:14:30
|
> I think the problem with setgroups(0, NULL): Operation not permitted has > been resolved. If you don't say *how* -- explain carefully what you changed, what your current settings are, then you leave us to guess. This is frustrating and you are less likely to receive any help this way. > At the first time I set > 'SUID_LOCATION' => array('VALUE' => > '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), > > I find in the /var/www/html/webmail/plugins/server_settings_backend also has > a squirrelmail_server_settings_suid_backend, and the file permission is > -rwsr-xr-x. > > So I change the SUID_LOCATION value to > /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend The only examples I can find point to the server_settings_backend directory. The copy of the suid_wrapper in the suid_backend directory shouldn't be used in your configuration. (I believe this is your oversight, unless you can point out where there was a misleading example.) > But get another error "Remote file name cannot contain "/"" in the > /var/log/httpd/error_log. This is good in general. If you really need directory traversal (why?), read the docs on how to compile the suid wrapper. And once again, READ THE DOCS **BEFORE** you ask for help. > And if I set "$ssf_debug_server_settings_backend = 1" in the > server_side_filters/config.php, and after I click "Options->Message Filters" > on the web browser, the web page only display the following message: > > Unable to retrieve file from command > "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend > 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' > '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" > > Can't understand why will it retrieve the > /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and > this file is not exist. > > > Bu Xiaobing -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-27 07:09:40
|
On 2013-6-25 7:14, Paul Lesniewski wrote: >> I think the problem with setgroups(0, NULL): Operation not permitted has >> been resolved. > > If you don't say *how* -- explain carefully what you changed, what > your current settings are, then you leave us to guess. This is > frustrating and you are less likely to receive any help this way. > >> At the first time I set >> 'SUID_LOCATION' => array('VALUE' => >> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >> >> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >> a squirrelmail_server_settings_suid_backend, and the file permission is >> -rwsr-xr-x. >> >> So I change the SUID_LOCATION value to >> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend > > The only examples I can find point to the server_settings_backend > directory. The copy of the suid_wrapper in the suid_backend directory > shouldn't be used in your configuration. (I believe this is your > oversight, unless you can point out where there was a misleading > example.) > >> But get another error "Remote file name cannot contain "/"" in the >> /var/log/httpd/error_log. > > This is good in general. If you really need directory traversal > (why?), read the docs on how to compile the suid wrapper. And once > again, READ THE DOCS **BEFORE** you ask for help. > >> And if I set "$ssf_debug_server_settings_backend = 1" in the >> server_side_filters/config.php, and after I click "Options->Message Filters" >> on the web browser, the web page only display the following message: >> >> Unable to retrieve file from command >> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >> >> Can't understand why will it retrieve the >> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >> this file is not exist. >> >> >> Bu Xiaobing > > > Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS and find the problems and it works now! |
From: Paul L. <pa...@sq...> - 2013-06-27 07:14:30
|
On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: > On 2013-6-25 7:14, Paul Lesniewski wrote: >>> I think the problem with setgroups(0, NULL): Operation not permitted has >>> been resolved. >> >> If you don't say *how* -- explain carefully what you changed, what >> your current settings are, then you leave us to guess. This is >> frustrating and you are less likely to receive any help this way. >> >>> At the first time I set >>> 'SUID_LOCATION' => array('VALUE' => >>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>> >>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>> a squirrelmail_server_settings_suid_backend, and the file permission is >>> -rwsr-xr-x. >>> >>> So I change the SUID_LOCATION value to >>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >> >> The only examples I can find point to the server_settings_backend >> directory. The copy of the suid_wrapper in the suid_backend directory >> shouldn't be used in your configuration. (I believe this is your >> oversight, unless you can point out where there was a misleading >> example.) >> >>> But get another error "Remote file name cannot contain "/"" in the >>> /var/log/httpd/error_log. >> >> This is good in general. If you really need directory traversal >> (why?), read the docs on how to compile the suid wrapper. And once >> again, READ THE DOCS **BEFORE** you ask for help. >> >>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>> server_side_filters/config.php, and after I click "Options->Message Filters" >>> on the web browser, the web page only display the following message: >>> >>> Unable to retrieve file from command >>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>> >>> Can't understand why will it retrieve the >>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>> this file is not exist. >>> >>> >>> Bu Xiaobing >> >> >> > > Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS > and find the problems and it works now! Thanks for reading the docs. I'd just caution you again *against* allowing directory traversal. There is no reason you should need that and it is less secure. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-27 07:37:02
|
On 2013-6-27 15:14, Paul Lesniewski wrote: > On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: >> On 2013-6-25 7:14, Paul Lesniewski wrote: >>>> I think the problem with setgroups(0, NULL): Operation not permitted has >>>> been resolved. >>> >>> If you don't say *how* -- explain carefully what you changed, what >>> your current settings are, then you leave us to guess. This is >>> frustrating and you are less likely to receive any help this way. >>> >>>> At the first time I set >>>> 'SUID_LOCATION' => array('VALUE' => >>>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>>> >>>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>>> a squirrelmail_server_settings_suid_backend, and the file permission is >>>> -rwsr-xr-x. >>>> >>>> So I change the SUID_LOCATION value to >>>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>> >>> The only examples I can find point to the server_settings_backend >>> directory. The copy of the suid_wrapper in the suid_backend directory >>> shouldn't be used in your configuration. (I believe this is your >>> oversight, unless you can point out where there was a misleading >>> example.) >>> >>>> But get another error "Remote file name cannot contain "/"" in the >>>> /var/log/httpd/error_log. >>> >>> This is good in general. If you really need directory traversal >>> (why?), read the docs on how to compile the suid wrapper. And once >>> again, READ THE DOCS **BEFORE** you ask for help. >>> >>>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>>> server_side_filters/config.php, and after I click "Options->Message Filters" >>>> on the web browser, the web page only display the following message: >>>> >>>> Unable to retrieve file from command >>>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>>> >>>> Can't understand why will it retrieve the >>>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>>> this file is not exist. >>>> >>>> >>>> Bu Xiaobing >>> >>> >>> >> >> Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS >> and find the problems and it works now! > > Thanks for reading the docs. I'd just caution you again *against* > allowing directory traversal. There is no reason you should need that > and it is less secure. > Do you mean I should not use SUID backend? For now, I need SUID to save a kickoff file .forward which contains "|exec /usr/bin/procmail || exit 75" at /home/USER, So I can invoke procmail to do filter. And I compiled SUID with --enable-auth=imap to do authentication. Bu xiaobing |
From: Paul L. <pa...@sq...> - 2013-06-27 07:50:59
|
On Thu, Jun 27, 2013 at 12:36 AM, Bu Xiaobing <bus...@gm...> wrote: > On 2013-6-27 15:14, Paul Lesniewski wrote: >> On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: >>> On 2013-6-25 7:14, Paul Lesniewski wrote: >>>>> I think the problem with setgroups(0, NULL): Operation not permitted has >>>>> been resolved. >>>> >>>> If you don't say *how* -- explain carefully what you changed, what >>>> your current settings are, then you leave us to guess. This is >>>> frustrating and you are less likely to receive any help this way. >>>> >>>>> At the first time I set >>>>> 'SUID_LOCATION' => array('VALUE' => >>>>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>>>> >>>>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>>>> a squirrelmail_server_settings_suid_backend, and the file permission is >>>>> -rwsr-xr-x. >>>>> >>>>> So I change the SUID_LOCATION value to >>>>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>> >>>> The only examples I can find point to the server_settings_backend >>>> directory. The copy of the suid_wrapper in the suid_backend directory >>>> shouldn't be used in your configuration. (I believe this is your >>>> oversight, unless you can point out where there was a misleading >>>> example.) >>>> >>>>> But get another error "Remote file name cannot contain "/"" in the >>>>> /var/log/httpd/error_log. >>>> >>>> This is good in general. If you really need directory traversal >>>> (why?), read the docs on how to compile the suid wrapper. And once >>>> again, READ THE DOCS **BEFORE** you ask for help. >>>> >>>>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>>>> server_side_filters/config.php, and after I click "Options->Message Filters" >>>>> on the web browser, the web page only display the following message: >>>>> >>>>> Unable to retrieve file from command >>>>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>>>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>>>> >>>>> Can't understand why will it retrieve the >>>>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>>>> this file is not exist. >>>>> >>>>> >>>>> Bu Xiaobing >>>> >>>> >>>> >>> >>> Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS >>> and find the problems and it works now! >> >> Thanks for reading the docs. I'd just caution you again *against* >> allowing directory traversal. There is no reason you should need that >> and it is less secure. >> > > Do you mean I should not use SUID backend? I never said such a thing. > For now, I need SUID to save a kickoff file .forward > which contains "|exec /usr/bin/procmail || exit 75" at /home/USER, Let the wrapper obtain the user home directory. The SquirrelMail side (the filters plugin) should only pass the name of the file (.forward) and no path information. > So I can invoke procmail to do filter. And I compiled SUID > with --enable-auth=imap to do authentication. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-06-27 07:58:35
|
On 2013-6-27 15:50, Paul Lesniewski wrote: > On Thu, Jun 27, 2013 at 12:36 AM, Bu Xiaobing <bus...@gm...> wrote: >> On 2013-6-27 15:14, Paul Lesniewski wrote: >>> On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: >>>> On 2013-6-25 7:14, Paul Lesniewski wrote: >>>>>> I think the problem with setgroups(0, NULL): Operation not permitted has >>>>>> been resolved. >>>>> >>>>> If you don't say *how* -- explain carefully what you changed, what >>>>> your current settings are, then you leave us to guess. This is >>>>> frustrating and you are less likely to receive any help this way. >>>>> >>>>>> At the first time I set >>>>>> 'SUID_LOCATION' => array('VALUE' => >>>>>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>>>>> >>>>>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>>>>> a squirrelmail_server_settings_suid_backend, and the file permission is >>>>>> -rwsr-xr-x. >>>>>> >>>>>> So I change the SUID_LOCATION value to >>>>>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>> >>>>> The only examples I can find point to the server_settings_backend >>>>> directory. The copy of the suid_wrapper in the suid_backend directory >>>>> shouldn't be used in your configuration. (I believe this is your >>>>> oversight, unless you can point out where there was a misleading >>>>> example.) >>>>> >>>>>> But get another error "Remote file name cannot contain "/"" in the >>>>>> /var/log/httpd/error_log. >>>>> >>>>> This is good in general. If you really need directory traversal >>>>> (why?), read the docs on how to compile the suid wrapper. And once >>>>> again, READ THE DOCS **BEFORE** you ask for help. >>>>> >>>>>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>>>>> server_side_filters/config.php, and after I click "Options->Message Filters" >>>>>> on the web browser, the web page only display the following message: >>>>>> >>>>>> Unable to retrieve file from command >>>>>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>>>>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>>>>> >>>>>> Can't understand why will it retrieve the >>>>>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>>>>> this file is not exist. >>>>>> >>>>>> >>>>>> Bu Xiaobing >>>>> >>>>> >>>>> >>>> >>>> Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS >>>> and find the problems and it works now! >>> >>> Thanks for reading the docs. I'd just caution you again *against* >>> allowing directory traversal. There is no reason you should need that >>> and it is less secure. >>> >> >> Do you mean I should not use SUID backend? > > I never said such a thing. > >> For now, I need SUID to save a kickoff file .forward >> which contains "|exec /usr/bin/procmail || exit 75" at /home/USER, > > Let the wrapper obtain the user home directory. The SquirrelMail side > (the filters plugin) should only pass the name of the file (.forward) > and no path information. > >> So I can invoke procmail to do filter. And I compiled SUID >> with --enable-auth=imap to do authentication. > > I think I do as you suggest, the following is my server_side_filters/config.php $filtering_kickoff_file = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'SUID'), 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend'), 'FILE' => array('VALUE' => '.forward'), 'PARSE_PATTERN' => array('VALUE' => '#^(\"\|exec /usr/bin/procmail \|\| exit 75\")$#m'), 'NEW_SETTING_TEMPLATE' => array('VALUE' => "\"|exec /usr/bin/procmail || exit 75\"\n"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'MAX_SEQUENTIAL_EMPTY_LINES' => 3, 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), // un-comment the following to add to the top of existing files //'ADD_TO_TOP' => array('VALUE' => 1), ); Bu Xiaobing |
From: Bu X. <bus...@gm...> - 2013-06-27 08:00:57
|
On 2013-6-27 15:58, Bu Xiaobing wrote: > On 2013-6-27 15:50, Paul Lesniewski wrote: >> On Thu, Jun 27, 2013 at 12:36 AM, Bu Xiaobing <bus...@gm...> wrote: >>> On 2013-6-27 15:14, Paul Lesniewski wrote: >>>> On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: >>>>> On 2013-6-25 7:14, Paul Lesniewski wrote: >>>>>>> I think the problem with setgroups(0, NULL): Operation not permitted has >>>>>>> been resolved. >>>>>> >>>>>> If you don't say *how* -- explain carefully what you changed, what >>>>>> your current settings are, then you leave us to guess. This is >>>>>> frustrating and you are less likely to receive any help this way. >>>>>> >>>>>>> At the first time I set >>>>>>> 'SUID_LOCATION' => array('VALUE' => >>>>>>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>>>>>> >>>>>>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>>>>>> a squirrelmail_server_settings_suid_backend, and the file permission is >>>>>>> -rwsr-xr-x. >>>>>>> >>>>>>> So I change the SUID_LOCATION value to >>>>>>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>>> >>>>>> The only examples I can find point to the server_settings_backend >>>>>> directory. The copy of the suid_wrapper in the suid_backend directory >>>>>> shouldn't be used in your configuration. (I believe this is your >>>>>> oversight, unless you can point out where there was a misleading >>>>>> example.) >>>>>> >>>>>>> But get another error "Remote file name cannot contain "/"" in the >>>>>>> /var/log/httpd/error_log. >>>>>> >>>>>> This is good in general. If you really need directory traversal >>>>>> (why?), read the docs on how to compile the suid wrapper. And once >>>>>> again, READ THE DOCS **BEFORE** you ask for help. >>>>>> >>>>>>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>>>>>> server_side_filters/config.php, and after I click "Options->Message Filters" >>>>>>> on the web browser, the web page only display the following message: >>>>>>> >>>>>>> Unable to retrieve file from command >>>>>>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>>>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>>>>>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>>>>>> >>>>>>> Can't understand why will it retrieve the >>>>>>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>>>>>> this file is not exist. >>>>>>> >>>>>>> >>>>>>> Bu Xiaobing >>>>>> >>>>>> >>>>>> >>>>> >>>>> Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS >>>>> and find the problems and it works now! >>>> >>>> Thanks for reading the docs. I'd just caution you again *against* >>>> allowing directory traversal. There is no reason you should need that >>>> and it is less secure. >>>> >>> >>> Do you mean I should not use SUID backend? >> >> I never said such a thing. >> >>> For now, I need SUID to save a kickoff file .forward >>> which contains "|exec /usr/bin/procmail || exit 75" at /home/USER, >> >> Let the wrapper obtain the user home directory. The SquirrelMail side >> (the filters plugin) should only pass the name of the file (.forward) >> and no path information. >> >>> So I can invoke procmail to do filter. And I compiled SUID >>> with --enable-auth=imap to do authentication. >> >> > > I think I do as you suggest, the following is my server_side_filters/config.php > > $filtering_kickoff_file = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'SUID'), > 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend'), > 'FILE' => array('VALUE' => '.forward'), > 'PARSE_PATTERN' => array('VALUE' => '#^(\"\|exec /usr/bin/procmail \|\| exit 75\")$#m'), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => "\"|exec /usr/bin/procmail || exit 75\"\n"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'MAX_SEQUENTIAL_EMPTY_LINES' => 3, > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > // un-comment the following to add to the top of existing files > //'ADD_TO_TOP' => array('VALUE' => 1), > ); > > Bu Xiaobing And this: $filter_rules_storage_info = array( 'BACKEND' => 'local_file', 'ACCESS_TYPE' => array('VALUE' => 'SUID'), 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend'), 'FILE' => array('VALUE' => '.procmailrc'), 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), 'SUID_DEBUG_OUTPUT' => array('VALUE' => '/tmp/squirrelmail_server_settings_backend_suid_debug'), ); |
From: Paul L. <pa...@sq...> - 2013-06-27 08:26:27
|
On Thu, Jun 27, 2013 at 1:00 AM, Bu Xiaobing <bus...@gm...> wrote: > On 2013-6-27 15:58, Bu Xiaobing wrote: >> On 2013-6-27 15:50, Paul Lesniewski wrote: >>> On Thu, Jun 27, 2013 at 12:36 AM, Bu Xiaobing <bus...@gm...> wrote: >>>> On 2013-6-27 15:14, Paul Lesniewski wrote: >>>>> On Thu, Jun 27, 2013 at 12:09 AM, Bu Xiaobing <bus...@gm...> wrote: >>>>>> On 2013-6-25 7:14, Paul Lesniewski wrote: >>>>>>>> I think the problem with setgroups(0, NULL): Operation not permitted has >>>>>>>> been resolved. >>>>>>> >>>>>>> If you don't say *how* -- explain carefully what you changed, what >>>>>>> your current settings are, then you leave us to guess. This is >>>>>>> frustrating and you are less likely to receive any help this way. >>>>>>> >>>>>>>> At the first time I set >>>>>>>> 'SUID_LOCATION' => array('VALUE' => >>>>>>>> '/var/www/html/webmail/plugins/server_settings_backend/suid_backend/squirrelmail_server_settings_suid_backend'), >>>>>>>> >>>>>>>> I find in the /var/www/html/webmail/plugins/server_settings_backend also has >>>>>>>> a squirrelmail_server_settings_suid_backend, and the file permission is >>>>>>>> -rwsr-xr-x. >>>>>>>> >>>>>>>> So I change the SUID_LOCATION value to >>>>>>>> /var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>>>> >>>>>>> The only examples I can find point to the server_settings_backend >>>>>>> directory. The copy of the suid_wrapper in the suid_backend directory >>>>>>> shouldn't be used in your configuration. (I believe this is your >>>>>>> oversight, unless you can point out where there was a misleading >>>>>>> example.) >>>>>>> >>>>>>>> But get another error "Remote file name cannot contain "/"" in the >>>>>>>> /var/log/httpd/error_log. >>>>>>> >>>>>>> This is good in general. If you really need directory traversal >>>>>>> (why?), read the docs on how to compile the suid wrapper. And once >>>>>>> again, READ THE DOCS **BEFORE** you ask for help. >>>>>>> >>>>>>>> And if I set "$ssf_debug_server_settings_backend = 1" in the >>>>>>>> server_side_filters/config.php, and after I click "Options->Message Filters" >>>>>>>> on the web browser, the web page only display the following message: >>>>>>>> >>>>>>>> Unable to retrieve file from command >>>>>>>> "/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend >>>>>>>> 'localhost' 'buxiaobing' 'get_file' '/home/buxiaobing/.mailfiter' >>>>>>>> '/var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D'" >>>>>>>> >>>>>>>> Can't understand why will it retrieve the >>>>>>>> /var/local/squirrelmail/attach/xo4HqZ6WpSq6iUazfx1TLAmw3SEg6p9D file and >>>>>>>> this file is not exist. >>>>>>>> >>>>>>>> >>>>>>>> Bu Xiaobing >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> Thanks for your help. I read the server_settings_backend/docs/SUID_BACKEND_ERRORS >>>>>> and find the problems and it works now! >>>>> >>>>> Thanks for reading the docs. I'd just caution you again *against* >>>>> allowing directory traversal. There is no reason you should need that >>>>> and it is less secure. >>>>> >>>> >>>> Do you mean I should not use SUID backend? >>> >>> I never said such a thing. >>> >>>> For now, I need SUID to save a kickoff file .forward >>>> which contains "|exec /usr/bin/procmail || exit 75" at /home/USER, >>> >>> Let the wrapper obtain the user home directory. The SquirrelMail side >>> (the filters plugin) should only pass the name of the file (.forward) >>> and no path information. >>> >>>> So I can invoke procmail to do filter. And I compiled SUID >>>> with --enable-auth=imap to do authentication. >>> >>> >> >> I think I do as you suggest, the following is my server_side_filters/config.php >> >> $filtering_kickoff_file = array( >> 'BACKEND' => 'local_file', >> 'ACCESS_TYPE' => array('VALUE' => 'SUID'), >> 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend'), >> 'FILE' => array('VALUE' => '.forward'), >> 'PARSE_PATTERN' => array('VALUE' => '#^(\"\|exec /usr/bin/procmail \|\| exit 75\")$#m'), >> 'NEW_SETTING_TEMPLATE' => array('VALUE' => "\"|exec /usr/bin/procmail || exit 75\"\n"), >> 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), >> 'MAX_SEQUENTIAL_EMPTY_LINES' => 3, >> 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), >> // un-comment the following to add to the top of existing files >> //'ADD_TO_TOP' => array('VALUE' => 1), >> ); >> >> Bu Xiaobing > > And this: > > $filter_rules_storage_info = array( > 'BACKEND' => 'local_file', > 'ACCESS_TYPE' => array('VALUE' => 'SUID'), > 'SUID_LOCATION' => array('VALUE' => '/var/www/html/webmail/plugins/server_settings_backend/squirrelmail_server_settings_suid_backend'), > 'FILE' => array('VALUE' => '.procmailrc'), Yup, good job. :-) > 'PARSE_PATTERN' => array('VALUE' => "/^(.*)$/s"), > 'PATTERN_GROUP_NUMBER' => array('VALUE' => 1), > 'NEW_SETTING_TEMPLATE' => array('VALUE' => '%1'), > 'DELETE_WHEN_EMPTY' => array('VALUE' => 1), > 'TREAT_AS_EMPTY_WHEN_NOT_FOUND' => array('VALUE' => 1), > 'SUID_DEBUG_OUTPUT' => array('VALUE' => '/tmp/squirrelmail_server_settings_backend_suid_debug'), > ); > -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php |
From: Bu X. <bus...@gm...> - 2013-07-01 11:36:36
|
Another problem about procmail configurations, here is my /etc/procmailrc file: MAILDIR=$HOME/mail ORGMAIL=/var/mail/$USER LOGFILE=$HOME/.maillog SHELL=/bin/sh LOCKFILE=$HOME/.lockmail VERBOSE=no DEFAULT=$ORGMAIL #procmail said the default DEFAULT value is the same as $ORGMAIL I add a filter rule: If From Contains bus...@gm... then Move to Folder gmail Then it will be saved into /home/buxiaobing/.procmailrc as the following: ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## # ####RULE#### From-''-bu...@gm...-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- :0H: * ^From: .*bushurui@gmail\.com $DEFAULT/gmail # ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES ########## ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## So the mail sent from bus...@gm... will saved to $DEFAULT/gmail(/var/mail/buxiaobing/gmail), /var/mail/buxiaobing is a file, I use mbox format, in fact it should be saved to $MAILDIR/gmail How can I remove the $DEFAULT/ prefix and directly save as follows? * ^From: .*bushurui@gmail\.com gmail I have already defined my mailbox format at server_side_filters_procmail/config.php // Indicates whether or not your mail store is organized using // mailboxes or maildirs. If you do not know which, you should // make that determination before proceeding here, or filtering // will not work. // // 1 = use maildir syntax // 0 (zero) = use mailbox syntax // $use_maildirs = 0; And if I set $use_maildirs = 1; Then add the filter rule, the onlu difference is there will be a "/" appended at the end of the gmail and the prefix $DEFAULT/ still alive. ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## # ####RULE#### From-''-bu...@gm...-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- :0H: * ^From: .*bushurui@gmail\.com $DEFAULT/gmail/ |
From: Bu X. <bus...@gm...> - 2013-07-01 14:02:28
|
On 2013-7-1 19:36, Bu Xiaobing wrote: > > Another problem about procmail configurations, here is my /etc/procmailrc file: > > MAILDIR=$HOME/mail > ORGMAIL=/var/mail/$USER > LOGFILE=$HOME/.maillog > SHELL=/bin/sh > LOCKFILE=$HOME/.lockmail > VERBOSE=no > DEFAULT=$ORGMAIL #procmail said the default DEFAULT value is the same as $ORGMAIL > > > I add a filter rule: > If From Contains bus...@gm... then Move to Folder gmail > Then it will be saved into /home/buxiaobing/.procmailrc as the following: > > ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## > ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## > # > ####RULE#### From-''-bu...@gm...-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- > :0H: > * ^From: .*bushurui@gmail\.com > $DEFAULT/gmail > > > # > ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES ########## > ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## > > So the mail sent from bus...@gm... will saved to $DEFAULT/gmail(/var/mail/buxiaobing/gmail), /var/mail/buxiaobing is a file, I use mbox format, in fact it should be saved to $MAILDIR/gmail > > How can I remove the $DEFAULT/ prefix and directly save as follows? > > * ^From: .*bushurui@gmail\.com > gmail > > > I have already defined my mailbox format at server_side_filters_procmail/config.php > // Indicates whether or not your mail store is organized using > // mailboxes or maildirs. If you do not know which, you should > // make that determination before proceeding here, or filtering > // will not work. > // > // 1 = use maildir syntax > // 0 (zero) = use mailbox syntax > // > $use_maildirs = 0; > > And if I set $use_maildirs = 1; > > Then add the filter rule, the onlu difference is there will be a "/" appended at the end of the gmail and the prefix $DEFAULT/ still alive. > > ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES ########## > ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ########## > # > ####RULE#### From-''-bu...@gm...-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''- > :0H: > * ^From: .*bushurui@gmail\.com > $DEFAULT/gmail/ > > > > I changed the server_side_filters_procmail/functions.php as the followings where MAILDIR=$HOME/mail was configured in /etc/procmailrc 161 // determine the right path to the user's mail store 162 // 163 if (empty($custom_mail_location)) 164 { 165 $mail_location = NULL; 166 $folder_path_prefix = '$MAILDIR'; 167 //$folder_path_prefix = '$DEFAULT'; 168 } 169 else 170 { And now it can works as I want, unfiltered mails will delivered to the DEFAULT=/var/mail/$USER location, and filtered mails will delivered to MAILDIR=$HOME/mail/folder_name. |