# HG changeset patch # User Charlie Root # Date 1546078228 18000 # Node ID a36beb7d3ea2ec15f3ac026566d912aadda4b7cb # Parent 05c4c32948af818eb055bb6054d5757112104be2 minor stuff left-over from january diff -r 05c4c32948af -r a36beb7d3ea2 .htaccess --- a/.htaccess Thu Aug 30 16:21:59 2018 -0400 +++ b/.htaccess Sat Dec 29 05:10:28 2018 -0500 @@ -1,89 +1,1 @@ -# WARNING: For PHP 7 the module name in the line below need to be modified! - -php_flag display_errors Off -php_flag log_errors On -# php_value error_log logs/errors - -php_value upload_max_filesize 5M -php_value post_max_size 6M -php_value memory_limit 64M - -php_flag zlib.output_compression Off -php_flag suhosin.session.encrypt Off - -#php_value session.cookie_path / -#php_value session.hash_function sha256 -php_flag session.auto_start Off -php_value session.gc_maxlifetime 21600 -php_value session.gc_divisor 500 -php_value session.gc_probability 1 - - - -Options +SymLinksIfOwnerMatch -RewriteEngine On -RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico - -# security rules: -# - deny access to files not containing a dot or starting with a dot -# in all locations except installer directory -RewriteRule ^(?!installer|\.well-known\/|[a-zA-Z0-9]{16})(\.?[^\.]+)$ - [F] -# - deny access to some locations -RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F] -# - deny access to composer binaries -RewriteRule ^/vendor\/bin\/.* - [F] -# - deny access to some documentation files -RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml|jsdeps.json|Dockerfile)$ - [F] - - - -SetOutputFilter DEFLATE - - - -ExpiresActive On -ExpiresDefault "access plus 1 month" - - -FileETag MTime Size - - -Options -Indexes - - - -# Disable page indexing -Header set X-Robots-Tag "noindex, nofollow" - -# replace 'append' with 'merge' for Apache version 2.2.9 and later -#Header append Cache-Control public env=!NO_CACHE - -# Optional security header -# Only increased security if the browser support those features -# Be careful! Testing is required! They should be adusted to your intallation / user environment - -# HSTS - HTTP Strict Transport Security -#Header always set Strict-Transport-Security "max-age=31536000; preload" env=HTTPS - -# HPKP - HTTP Public Key Pinning -# Only template - fill with your values -#Header always set Public-Key-Pins "max-age=3600; report-uri=\"\"; pin-sha256=\"\"; pin-sha256=\"\"" env=HTTPS - -# X-Xss-Protection -# This header is used to configure the built in reflective XSS protection found in Internet Explorer, Chrome and Safari (Webkit). -#Header set X-XSS-Protection "1; mode=block" - -# X-Frame-Options -# The X-Frame-Options header (RFC), or XFO header, protects your visitors against clickjacking attacks -# Already set by php code! Do not activate both options -#Header set X-Frame-Options SAMEORIGIN - -# X-Content-Type-Options -# It prevents Google Chrome and Internet Explorer from trying to mime-sniff the content-type of a response away from the one being declared by the server. -#Header set X-Content-Type-Options: "nosniff" - -# CSP - Content Security Policy -# for better privacy/security ask browsers to not set the Referer -# more flags for script, stylesheets and images available, read RFC for more information -#Header set Content-Security-Policy "referrer no-referrer" - +/etc/roundcube/htaccess \ No newline at end of file diff -r 05c4c32948af -r a36beb7d3ea2 index.php --- a/index.php Thu Aug 30 16:21:59 2018 -0400 +++ b/index.php Sat Dec 29 05:10:28 2018 -0500 @@ -1,326 +1,1 @@ - | - | Author: Aleksander Machniak | - +-------------------------------------------------------------------------+ -*/ - -// include environment -require_once 'program/include/iniset.php'; - -// init application, start session, init output class, etc. -$RCMAIL = rcmail::get_instance(0, $GLOBALS['env']); - -// Make the whole PHP output non-cacheable (#1487797) -$RCMAIL->output->nocacheing_headers(); -$RCMAIL->output->common_headers(); - -// turn on output buffering -ob_start(); - -// check if config files had errors -if ($err_str = $RCMAIL->config->get_error()) { - rcmail::raise_error(array( - 'code' => 601, - 'type' => 'php', - 'message' => $err_str), false, true); -} - -// check DB connections and exit on failure -if ($err_str = $RCMAIL->db->is_error()) { - rcmail::raise_error(array( - 'code' => 603, - 'type' => 'db', - 'message' => $err_str), false, true); -} - -// error steps -if ($RCMAIL->action == 'error' && !empty($_GET['_code'])) { - rcmail::raise_error(array('code' => hexdec($_GET['_code'])), false, true); -} - -// check if https is required (for login) and redirect if necessary -if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) { - // force_https can be true, , :, - if (!is_bool($force_https)) { - list($host, $port) = explode(':', $force_https); - - if (is_numeric($host) && empty($port)) { - $port = $host; - $host = ''; - } - } - - if (!rcube_utils::https_check($port ?: 443)) { - if (empty($host)) { - $host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']); - } - if ($port && $port != 443) { - $host .= ':' . $port; - } - - header('Location: https://' . $host . $_SERVER['REQUEST_URI']); - exit; - } -} - -// trigger startup plugin hook -$startup = $RCMAIL->plugins->exec_hook('startup', array('task' => $RCMAIL->task, 'action' => $RCMAIL->action)); -$RCMAIL->set_task($startup['task']); -$RCMAIL->action = $startup['action']; - -// try to log in -if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') { - $request_valid = $_SESSION['temp'] && $RCMAIL->check_request(); - $pass_charset = $RCMAIL->config->get('password_charset', 'ISO-8859-1'); - - // purge the session in case of new login when a session already exists - $RCMAIL->kill_session(); - - $auth = $RCMAIL->plugins->exec_hook('authenticate', array( - 'host' => $RCMAIL->autoselect_host(), - 'user' => trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST)), - 'pass' => rcube_utils::get_input_value('_pass', rcube_utils::INPUT_POST, true, $pass_charset), - 'valid' => $request_valid, - 'cookiecheck' => true, - )); - - // Login - if ($auth['valid'] && !$auth['abort'] - && $RCMAIL->login($auth['user'], $auth['pass'], $auth['host'], $auth['cookiecheck']) - ) { - // create new session ID, don't destroy the current session - // it was destroyed already by $RCMAIL->kill_session() above - $RCMAIL->session->remove('temp'); - $RCMAIL->session->regenerate_id(false); - - // send auth cookie if necessary - $RCMAIL->session->set_auth_cookie(); - - // log successful login - $RCMAIL->log_login(); - - // restore original request parameters - $query = array(); - if ($url = rcube_utils::get_input_value('_url', rcube_utils::INPUT_POST)) { - parse_str($url, $query); - - // prevent endless looping on login page - if ($query['_task'] == 'login') { - unset($query['_task']); - } - - // prevent redirect to compose with specified ID (#1488226) - if ($query['_action'] == 'compose' && !empty($query['_id'])) { - $query = array('_action' => 'compose'); - } - } - - // allow plugins to control the redirect url after login success - $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail')); - unset($redir['abort'], $redir['_err']); - - // send redirect - $OUTPUT->redirect($redir, 0, true); - } - else { - if (!$auth['valid']) { - $error_code = rcmail::ERROR_INVALID_REQUEST; - } - else { - $error_code = is_numeric($auth['error']) ? $auth['error'] : $RCMAIL->login_error(); - } - - $error_labels = array( - rcmail::ERROR_STORAGE => 'storageerror', - rcmail::ERROR_COOKIES_DISABLED => 'cookiesdisabled', - rcmail::ERROR_INVALID_REQUEST => 'invalidrequest', - rcmail::ERROR_INVALID_HOST => 'invalidhost', - rcmail::ERROR_RATE_LIMIT => 'accountlocked', - ); - - $error_message = !empty($auth['error']) && !is_numeric($auth['error']) ? $auth['error'] : ($error_labels[$error_code] ?: 'loginfailed'); - - $OUTPUT->show_message($error_message, 'warning'); - - // log failed login - $RCMAIL->log_login($auth['user'], true, $error_code); - - $RCMAIL->plugins->exec_hook('login_failed', array( - 'code' => $error_code, 'host' => $auth['host'], 'user' => $auth['user'])); - - $RCMAIL->kill_session(); - } -} - -// end session -else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id'])) { - $RCMAIL->request_security_check($mode = rcube_utils::INPUT_GET); - - $userdata = array( - 'user' => $_SESSION['username'], - 'host' => $_SESSION['storage_host'], - 'lang' => $RCMAIL->user->language, - ); - - $OUTPUT->show_message('loggedout'); - - $RCMAIL->logout_actions(); - $RCMAIL->kill_session(); - $RCMAIL->plugins->exec_hook('logout_after', $userdata); -} - -// check session and auth cookie -else if ($RCMAIL->task != 'login' && $_SESSION['user_id']) { - if (!$RCMAIL->session->check_auth()) { - $RCMAIL->kill_session(); - $session_error = true; - } -} - -// not logged in -> show login page -if (empty($RCMAIL->user->ID)) { - // log session failures - $task = rcube_utils::get_input_value('_task', rcube_utils::INPUT_GPC); - - if ($task && !in_array($task, array('login','logout')) - && !$session_error && ($sess_id = $_COOKIE[ini_get('session.name')]) - ) { - $RCMAIL->session->log("Aborted session $sess_id; no valid session data found"); - $session_error = true; - } - - if ($session_error || $_REQUEST['_err'] == 'session') { - $OUTPUT->show_message('sessionerror', 'error', null, true, -1); - } - - if ($OUTPUT->ajax_call || $OUTPUT->get_env('framed')) { - $OUTPUT->command('session_error', $RCMAIL->url(array('_err' => 'session'))); - $OUTPUT->send('iframe'); - } - - // check if installer is still active - if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) { - $OUTPUT->add_footer(html::div(array('style' => "background:#ef9398; border:2px solid #dc5757; padding:0.5em; margin:2em auto; width:50em"), - html::tag('h2', array('style' => "margin-top:0.2em"), "Installer script is still accessible") . - html::p(null, "The install script of your Roundcube installation is still stored in its default location!") . - html::p(null, "Please remove the whole installer folder from the Roundcube directory because - these files may expose sensitive configuration data like server passwords and encryption keys - to the public. Make sure you cannot access the installer script from your browser.") - )); - } - - $plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array('task' => 'login', 'error' => $session_error)); - - $RCMAIL->set_task($plugin['task']); - - $OUTPUT->send($plugin['task']); -} -else { - // CSRF prevention - $RCMAIL->request_security_check(); - - // check access to disabled actions - $disabled_actions = (array) $RCMAIL->config->get('disabled_actions'); - if (in_array($RCMAIL->task . '.' . ($RCMAIL->action ?: 'index'), $disabled_actions)) { - rcube::raise_error(array( - 'code' => 404, 'type' => 'php', - 'message' => "Action disabled"), true, true); - } -} - -// we're ready, user is authenticated and the request is safe -$plugin = $RCMAIL->plugins->exec_hook('ready', array('task' => $RCMAIL->task, 'action' => $RCMAIL->action)); -$RCMAIL->set_task($plugin['task']); -$RCMAIL->action = $plugin['action']; - -// handle special actions -if ($RCMAIL->action == 'keep-alive') { - $OUTPUT->reset(); - $RCMAIL->plugins->exec_hook('keep_alive', array()); - $OUTPUT->send(); -} -else if ($RCMAIL->action == 'save-pref') { - include INSTALL_PATH . 'program/steps/utils/save_pref.inc'; -} - - -// include task specific functions -if (is_file($incfile = INSTALL_PATH . 'program/steps/'.$RCMAIL->task.'/func.inc')) { - include_once $incfile; -} - -// allow 5 "redirects" to another action -$redirects = 0; $incstep = null; -while ($redirects < 5) { - // execute a plugin action - if (preg_match('/^plugin\./', $RCMAIL->action)) { - $RCMAIL->plugins->exec_action($RCMAIL->action); - break; - } - // execute action registered to a plugin task - else if ($RCMAIL->plugins->is_plugin_task($RCMAIL->task)) { - if (!$RCMAIL->action) $RCMAIL->action = 'index'; - $RCMAIL->plugins->exec_action($RCMAIL->task.'.'.$RCMAIL->action); - break; - } - // try to include the step file - else if (($stepfile = $RCMAIL->get_action_file()) - && is_file($incfile = INSTALL_PATH . 'program/steps/'.$RCMAIL->task.'/'.$stepfile) - ) { - // include action file only once (in case it don't exit) - include_once $incfile; - $redirects++; - } - else { - #rcube::write_log('mail',$incfile." not found"); - break; - } -} - -if ($RCMAIL->action == 'refresh') { - $RCMAIL->plugins->exec_hook('refresh', array('last' => intval(rcube_utils::get_input_value('_last', rcube_utils::INPUT_GPC)))); -} - -#rcube::write_log('mail',"task: ".$RCMAIL->task." action: ".$RCMAIL->action); -// parse main template (default) -$OUTPUT->send($RCMAIL->task); - -// if we arrive here, something went wrong -rcmail::raise_error(array( - 'code' => 404, - 'type' => 'php', - 'line' => __LINE__, - 'file' => __FILE__, - 'message' => "Invalid request"), true, true); +/usr/share/roundcube/index.php \ No newline at end of file diff -r 05c4c32948af -r a36beb7d3ea2 plugins/password/config.inc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/password/config.inc.php Sat Dec 29 05:10:28 2018 -0500 @@ -0,0 +1,483 @@ + Clusters -> Remote Access Key +$config['password_cpanel_hash'] = ''; + +// The cPanel port to use +$config['password_cpanel_port'] = 2087; + + +// cPanel Webmail Driver options +// ----------------------------- +// The cPanel Host name +$config['password_cpanel_webmail_host'] = 'host.domain.com'; + +// The cPanel port to use +$config['password_cpanel_webmail_port'] = 2096; + + +// XIMSS (Communigate server) Driver options +// ----------------------------------------- +// Host name of the Communigate server +$config['password_ximss_host'] = 'mail.example.com'; + +// XIMSS port on Communigate server +$config['password_ximss_port'] = 11024; + + +// chpasswd Driver options +// --------------------- +// Command to use (see "Sudo setup" in README) +$config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null'; + + +// XMail Driver options +// --------------------- +$config['xmail_host'] = 'localhost'; +$config['xmail_user'] = 'YourXmailControlUser'; +$config['xmail_pass'] = 'YourXmailControlPass'; +$config['xmail_port'] = 6017; + + +// hMail Driver options +// ----------------------- +// Remote hMailServer configuration +// true: HMailserver is on a remote box (php.ini: com.allow_dcom = true) +// false: Hmailserver is on same box as PHP +$config['hmailserver_remote_dcom'] = false; +// Windows credentials +$config['hmailserver_server'] = array( + 'Server' => 'localhost', // hostname or ip address + 'Username' => 'administrator', // windows username + 'Password' => 'password' // windows user password +); + + +// Virtualmin Driver options +// ------------------------- +// Username format: +// 0: username@domain +// 1: username%domain +// 2: username.domain +// 3: domain.username +// 4: username-domain +// 5: domain-username +// 6: username_domain +// 7: domain_username +$config['password_virtualmin_format'] = 0; + + +// pw_usermod Driver options +// -------------------------- +// Use comma delimited exlist to disable password change for users. +// See "Sudo setup" in README file. +$config['password_pw_usermod_cmd'] = 'sudo /usr/sbin/pw usermod -h 0 -n'; + + +// DBMail Driver options +// ------------------- +// Additional arguments for the dbmail-users call +$config['password_dbmail_args'] = '-p sha512'; + + +// Expect Driver options +// --------------------- +// Location of expect binary +$config['password_expect_bin'] = '/usr/bin/expect'; + +// Location of expect script (see helpers/passwd-expect) +$config['password_expect_script'] = ''; + +// Arguments for the expect script. See the helpers/passwd-expect file for details. +// This is probably a good starting default: +// -telent -host localhost -output /tmp/passwd.log -log /tmp/passwd.log +$config['password_expect_params'] = ''; + + +// smb Driver options +// --------------------- +// Samba host (default: localhost) +// Supported replacement variables: +// %n - hostname ($_SERVER['SERVER_NAME']) +// %t - hostname without the first part +// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) +$config['password_smb_host'] = 'localhost'; +// Location of smbpasswd binary (default: /usr/bin/smbpasswd) +$config['password_smb_cmd'] = '/usr/bin/smbpasswd'; + +// gearman driver options +// --------------------- +// Gearman host (default: localhost) +$config['password_gearman_host'] = 'localhost'; + + +// Plesk/PPA Driver options +// -------------------- +// You need to allow RCP for IP of roundcube-server in Plesk/PPA Panel + +// Plesk RCP Host +$config['password_plesk_host'] = '10.0.0.5'; + +// Plesk RPC Username +$config['password_plesk_user'] = 'admin'; + +// Plesk RPC Password +$config['password_plesk_pass'] = 'password'; + +// Plesk RPC Port +$config['password_plesk_rpc_port'] = '8443'; + +// Plesk RPC Path +$config['password_plesk_rpc_path'] = 'enterprise/control/agent.php'; + + +// kasswd Driver options +// --------------------- +// Command to use +$config['password_kpasswd_cmd'] = '/usr/bin/kpasswd'; diff -r 05c4c32948af -r a36beb7d3ea2 plugins/thunderbird_labels/localization/en_CA.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/thunderbird_labels/localization/en_CA.inc Sat Dec 29 05:10:28 2018 -0500 @@ -0,0 +1,1 @@ +en_US.inc \ No newline at end of file diff -r 05c4c32948af -r a36beb7d3ea2 plugins/thunderbird_labels/localization/en_GB.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/thunderbird_labels/localization/en_GB.inc Sat Dec 29 05:10:28 2018 -0500 @@ -0,0 +1,1 @@ +en_US.inc \ No newline at end of file