Skip to content

Commit

Permalink
updated ircube package
Browse files Browse the repository at this point in the history
1. markasjunk2.php: fixed syntax error
2. roundcube_config: changed php-fpm.sock location to /run/php-fpm
  • Loading branch information
mbhangui committed Jul 21, 2023
1 parent 99f1982 commit 3506458
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
3 changes: 3 additions & 0 deletions ircube-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Release 1.0.0-1.1 Start 13/09/2022 End 20/04/2023
09. Add qcerts supplementary group for apache to read indimail certs.
06/05/2023
10. roundcube_config: install selinux module for roundcubemail
20/07/2023
11. markasjunk2.php: fixed syntax error
12. roundcube_config: changed php-fpm.sock location to /run/php-fpm

* Thu 08 Sep 2022 14:38:16 +0000 Manvendra Bhangui <ircube@indimail.org> 1.0.0-1.1%{?dist}
Release @version@-@release@ Start 13/03/2017 End 08/09/2022
Expand Down
15 changes: 12 additions & 3 deletions ircube-x/plugins/markasjunk2/markasjunk2.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ function set_flags($p)
$this->ham_flag => $rcmail->config->get('markasjunk2_ham_flag')
);

$p['message_flags'] = array_merge((array)$p['message_flags'], $flags);
// $p['message_flags'] = array_merge((array)$p['message_flags'], $flags);
if (!empty($p['message_flags'])) {
$p['message_flags'] = array_merge((array)$p['message_flags'], $flags);
} else {
$p['message_flags'] = $flags;
}

return $p;
}
Expand Down Expand Up @@ -260,7 +265,11 @@ private function _call_driver($action, &$uids = null, $mbox = null)
elseif ($action == 'init' && method_exists($object, 'init')) // method_exists check here for backwards compatibility, init method added 20161127
$object->init();

return $object->is_error ? false : true;
//return $object->is_error ? false : true;
if (!empty($object->is_error))
return false;
else
return true;
}

private function _messageset_to_uids($messageset, $multi_folder)
Expand All @@ -277,4 +286,4 @@ private function _messageset_to_uids($messageset, $multi_folder)
}
}

?>
?>
39 changes: 19 additions & 20 deletions ircube-x/roundcube_config
Original file line number Diff line number Diff line change
Expand Up @@ -331,26 +331,22 @@ configure_php_conf()
tmp=$(mktemp -t httpd.tmp.XXXXXXXXXX)
(
echo ""
echo "# Tell the PHP interpreter to handle files with a .php extension."
echo "<Directory /var/www/html>"
echo " Options -Indexes +FollowSymLinks +MultiViews"
echo " AllowOverride All"
echo " Require all granted"
echo "</Directory>"
echo ""
echo "# Proxy declaration"
echo "<Proxy \"unix:/run/php/php-fpm.sock|fcgi://php-fpm\">"
echo " # we must declare a parameter in here (doesn't matter which) or it'll not register the proxy ahead of time"
echo " ProxySet disablereuse=off"
echo "</Proxy>"
echo "ProxyPassMatch \"^/(.*\.php(/.*)?)$\" \"unix:$rundir/php-fpm/php-fpm.sock|fcgi://localhost:9000\""
echo ""
echo "# Redirect to the proxy"
echo "<FilesMatch \.php$>"
echo " SetHandler proxy:fcgi://php-fpm"
echo " # 2.4.10+ can proxy to unix socket"
echo " SetHandler \"proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost:9000\""
echo "</FilesMatch>"
) > $tmp
$sed -i \
-e "/<\/Files>/ r $tmp" \
-e "s{^ <FilesMatch \\\.(php|phar)$>{#&{g" \
-e "s{^ SetHandler application/x-httpd-php{#&{g" \
-e "s{^ SetHandler \"proxy:unix:.*\"{#&{g" \
-e "s{^.*SetHandler \"proxy:unix:/run/php-fpm/www.sock|fcgi://localhost\"{ SetHandler \"proxy:unix:/run/php/php-fpm.sock|fcgi://localhost\"{g" \
-e "s{^ </FilesMatch>{#&{g" \
-e "s{^.*SetHandler \"proxy:unix:$rundir/php-fpm/www.sock|fcgi://localhost\"{ SetHandler \"proxy:unix:$rundir/php-fpm/php-fpm.sock|fcgi://localhost:9000\"{g" \
/etc/httpd/conf.d/php.conf
/bin/rm -f $tmp
fi
Expand Down Expand Up @@ -461,11 +457,15 @@ if [ -n "$php" -a -n "$php_ini" -a -f $php_ini ] ; then
fi
$cp "$php_ini".BAK $php_ini
$sed -i \
-e "s}pdo_mysql.default_socket=.*}pdo_mysql.default_socket=$mysql_sock}g" \
-e "s}; short_open_tag}short_open_tag = On}g" \
-e "s}upload_max_filesize.*}upload_max_filesize = 5M}g" \
-e "s}session.auto_start.*}session.auto_start = Off}g" \
-e "s}^session.gc_maxlifetime.*}session.gc_maxlifetime = 21600}g" \
-e "s};.*session.gc_divisor.*}session.gc_divisor = 500}g" \
-e "s}session.gc_probability.*}session.gc_probability = 1}g" \
-e "s};.*short_open_tag}short_open_tag = On}g" \
-e "s}max_execution_time.*}max_execution_time = 60}g" \
-e "s}session.gc_probability =.*}session.gc_probability = 1}g" \
-e "s};sendmail_path =.*}sendmail_path = /usr/sbin/sendmail -t -i}g" \
-e "s}pdo_mysql.default_socket=.*}pdo_mysql.default_socket=$mysql_sock}g" \
-e "s};sendmail_path.*=.*}sendmail_path=/usr/sbin/sendmail -t -i}g" \
-e "s};openssl.cafile=.*}openssl.cafile=/etc/indimail/certs/servercert.pem}g" \
-e "s};openssl.capath=.*}openssl.capath=/etc/indimail/certs}g" \
$php_ini
Expand Down Expand Up @@ -591,7 +591,7 @@ elif [ -f /etc/debian_version ] ; then
echo ""
echo " <FilesMatch \.php$>"
echo " # 2.4.10+ can proxy to unix socket"
echo " SetHandler \"proxy:unix:/run/php/php-fpm.sock|fcgi://localhost/\""
echo " SetHandler \"proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/\""
echo " # Else we can just use a tcp socket:"
echo " #SetHandler \"proxy:fcgi://127.0.0.1:9000\""
echo " </FilesMatch>"
Expand Down Expand Up @@ -680,11 +680,10 @@ if [ -n "$php_fpm_www_conf" -a -f $php_fpm_www_conf ] ; then
$sed -i \
-e "s}^user = nobody}user = $httpd_user}" \
-e "s}^group = nobody}group = $httpd_group}" \
-e 's}listen = .*}listen = /run/php/php-fpm.sock}' \
-e 's}listen = .*}listen = /run/php-fpm/php-fpm.sock}' \
-e "s};listen.owner = nobody}listen.owner = $httpd_user}g" \
-e "s};listen.group = nobody}listen.group = $httpd_group}g" \
-e 's};listen.mode = 0660}listen.mode = 0660}g' \
-e 's}^listen.acl_users.};&}' \
$php_fpm_www_conf
fi
if [ -n "$php_fpm_conf" -a -f "$php_fpm_conf" ] ; then
Expand Down

0 comments on commit 3506458

Please sign in to comment.