diff --git a/CHANGELOG b/CHANGELOG index 5c9d06f12..75e82da83 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Support additional connect parameters in PostgreSQL database wrapper - Use UI dialogs instead of confirm() and alert() where possible - Display value of the SMTP message size limit in the error message (#6032) - Skip redundant INSERT query on successful logon when using PHP7 diff --git a/program/lib/Roundcube/rcube_db_pgsql.php b/program/lib/Roundcube/rcube_db_pgsql.php index 8921d5cad..12ad7f1f8 100644 --- a/program/lib/Roundcube/rcube_db_pgsql.php +++ b/program/lib/Roundcube/rcube_db_pgsql.php @@ -28,6 +28,9 @@ class rcube_db_pgsql extends rcube_db { public $db_provider = 'postgres'; + // See https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS + private static $libpq_connect_params = array("application_name", "sslmode", "sslcert", "sslkey", "sslrootcert", "sslcrl", "sslcompression", "service"); + /** * Object constructor * @@ -256,6 +259,12 @@ class rcube_db_pgsql extends rcube_db $params[] = 'dbname=' . $dsn['database']; } + foreach (self::$libpq_connect_params as $param) { + if ($dsn[$param]) { + $params[] = $param . '=' . $dsn[$param]; + } + } + if (!empty($params)) { $result .= implode(';', $params); }