1

Topic: Roundcube - can't change password for users after upgrade ubuntu

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.4
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: ubuntu 22.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After upgrade from ubuntu 18.04 to ubuntu 20.04

Aug 14 15:46:18 mail roundcube: <nd361c6o> [8239] C: A0002 ID ("name" "Roundcube" "version" "1.6.2" "php" "7.4.3-4ubuntu2.19" "os" "Linux" "command" "/mail/?_task=settings&_action=plugin.password-save")
Aug 14 15:46:18 mail roundcube: <nd361c6o> [8239] S: * ID ("name" "Dovecot")
Aug 14 15:46:18 mail roundcube: <nd361c6o> [8239] S: A0002 OK ID completed (0.001 + 0.000 secs).
Aug 14 15:46:18 mail roundcube: <nd361c6o> [1] UPDATE mailbox SET password=%D,pa
sswordlastchange=NOW() WHERE username='opo4@my.domain';
Aug 14 15:46:18 mail roundcube: <nd361c6o> DB Error: [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%D,passwordlastchange=NOW() WHERE username='opo4@my.domain'' at line 1 (SQL Query: UPDATE mailbox SET password=%D,passwordlastchange=NOW() WHERE username='opo4@my.domain') in /opt/www/roundcubemail-1.4.3/program/lib/Roundcube/rcube_db.php on line 567 (POST /mail/?_task=settings&_action=plugin.password-save)

mailmaster@mail:~$ php --version
PHP 7.4.3-4ubuntu2.19 (cli) (built: Jun 27 2023 15:49:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3-4ubuntu2.19, Copyright (c), by Zend Technologies

mailmaster@mail:~$ sed '/^;/d; /^$/d' /etc/php/7.4/fpm/php.ini
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions = posix_uname,eval,pcntl_wexitstatus,posix_getpwuid,xmlrpc_entity_decode,pcntl_wifstopped,pcntl_wifexited,pcntl_wifsignaled,phpAds_XmlRpc,pcntl_strerror,ftp_exec,pcntl_wtermsig,mysql_pconnect,proc_nice,pcntl_sigtimedwait,posix_kill,pcntl_sigprocmask,fput,phpinfo,system,phpAds_remoteInfo,ftp_login,inject_code,posix_mkfifo,highlight_file,escapeshellcmd,show_source,pcntl_wifcontinued,fp,pcntl_alarm,pcntl_wait,ini_alter,posix_setpgid,parse_ini_file,ftp_raw,pcntl_waitpid,pcntl_getpriority,ftp_connect,pcntl_signal_dispatch,pcntl_wstopsig,ini_restore,ftp_put,passthru,proc_terminate,posix_setsid,pcntl_signal,pcntl_setpriority,phpAds_xmlrpcEncode,pcntl_exec,ftp_nb_fput,ftp_get,phpAds_xmlrpcDecode,pcntl_sigwaitinfo,shell_exec,pcntl_get_last_error,ftp_rawlist,pcntl_fork,posix_setuid
disable_classes =
zend.enable_gc = On
zend.exception_ignore_args = On
expose_php = Off;
max_execution_time = 30
max_input_time = 60
memory_limit = 256M;
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 100M;
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 100M;
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=mcrypt.so
[CLI Server]
cli_server.color = On
[Date]
date.timezone = GMT
[filter]
[iconv]
[imap]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.save_path = "/var/lib/php/sessions"
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]
[ffi]

mailmaster@mail:~$ php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

mailmaster@mail:~$ mysql --version
mysql  Ver 15.1 Distrib 10.3.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Roundcube Webmail 1.6.2

mailmaster@mail:~$ cat /opt/www/roundcubemail/plugins/password/config.inc.php
<?php
$config['password_driver'] = "sql";
$config['password_strength_driver'] = null;
$config['password_confirm_current'] = true;
$config['password_minimum_length'] = 8;
$config['password_minimum_score'] = 0;
$config['password_log'] = true;
$config['password_login_exceptions'] = true;
$config['password_hosts'] = null;
$config['password_force_save'] = false;
$config['password_force_new_user'] = false;
$config['password_algorithm'] = 'clear';
$config['password_algorithm_prefix'] = '';
$config['password_dovecotpw'] = "/usr/bin/doveadm pw";
$config['password_dovecotpw_method'] = "SSHA512";
$config['password_dovecotpw_with_method'] = true;
$config['password_blowfish_cost'] = 12;
$config['password_disabled'] = false;
$config['password_username_format'] = '%u';
$config['password_db_dsn'] = "mysqli://roundcube:mypass@127.0.0.1/vmail";
$config['password_query'] = "UPDATE mailbox SET password=%D,passwordlastchange=NOW() WHERE username=%u";
$config['password_crypt_hash'] = 'md5';
$config['password_idn_ascii'] = false;
$config['password_hash_algorithm'] = 'sha1';
$config['password_hash_base64'] = false;
$config['password_pop_host'] = 'localhost';
$config['password_pop_port'] = 106;
$config['password_saslpasswd_args'] = '';
$config['password_ldap_host'] = 'localhost';
$config['password_ldap_port'] = '389';
$config['password_ldap_starttls'] = false;
$config['password_ldap_version'] = '3';
$config['password_ldap_basedn'] = 'dc=exemple,dc=com';
$config['password_ldap_method'] = 'user';
$config['password_ldap_adminDN'] = null;
$config['password_ldap_adminPW'] = null;
$config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com';
$config['password_ldap_searchDN'] = 'cn=roundcube,ou=services,dc=example,dc=com';
$config['password_ldap_searchPW'] = 'secret';
$config['password_ldap_search_base'] = 'ou=people,dc=example,dc=com';
$config['password_ldap_search_filter'] = '(uid=%login)';
$config['password_ldap_encodage'] = 'crypt';
$config['password_ldap_pwattr'] = 'userPassword';
$config['password_ldap_force_replace'] = true;
$config['password_ldap_lchattr'] = '';
$config['password_ldap_samba_pwattr'] = '';
$config['password_ldap_samba_lchattr'] = '';
$config['password_ldap_ppolicy_cmd'] = 'change_ldap_pass.pl';
$config['password_ldap_ppolicy_uri'] = 'ldap://localhost/';
$config['password_ldap_ppolicy_basedn'] = 'dc=example,dc=com';
$config['password_ldap_ppolicy_searchDN'] = 'cn=someuser,dc=example,dc=com';
$config['password_ldap_ppolicy_searchPW'] = 'secret';
$config['password_ldap_ppolicy_search_filter'] = '(uid=%login)';
$config['password_ldap_ppolicy_cafile'] = '/etc/ssl/cacert.crt';
$config['password_directadmin_host'] = 'tcp://localhost';
$config['password_directadmin_port'] = 2222;
$config['password_vpopmaild_host'] = 'localhost';
$config['password_vpopmaild_port'] = 89;
$config['password_vpopmaild_timeout'] = 10;
$config['password_cpanel_host'] = 'host.domain.com';
$config['password_cpanel_username'] = 'username';
$config['password_cpanel_password'] = 'password';
$config['password_cpanel_hash'] = '';
$config['password_cpanel_port'] = 2087;
$config['password_cpanel_webmail_host'] = 'host.domain.com';
$config['password_cpanel_webmail_port'] = 2096;
$config['password_ximss_host'] = 'mail.example.com';
$config['password_ximss_port'] = 11024;
$config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';
$config['xmail_host'] = 'localhost';
$config['xmail_user'] = 'YourXmailControlUser';
$config['xmail_pass'] = 'YourXmailControlPass';
$config['xmail_port'] = 6017;
$config['hmailserver_remote_dcom'] = false;
$config['hmailserver_server'] = array(
    'Server'   => 'localhost',      // hostname or ip address
    'Username' => 'administrator',  // windows username
    'Password' => 'password'        // windows user password
);
$config['password_pw_usermod_cmd'] = 'sudo /usr/sbin/pw usermod -h 0 -n';
$config['password_dbmail_args'] = '-p sha512';
$config['password_expect_bin'] = '/usr/bin/expect';
$config['password_expect_script'] = '';
$config['password_expect_params'] = '';
$config['password_smb_host'] = 'localhost';
$config['password_smb_cmd'] = '/usr/bin/smbpasswd';
$config['password_gearman_host'] = 'localhost';
$config['password_plesk_host'] = '10.0.0.5';
$config['password_plesk_user'] = 'admin';
$config['password_plesk_pass'] = 'password';
$config['password_plesk_rpc_port'] = '8443';
$config['password_plesk_rpc_path'] = 'enterprise/control/agent.php';
$config['password_kpasswd_cmd'] = '/usr/bin/kpasswd';
$config['password_modoboa_api_token'] = '';

Help, plese.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube - can't change password for users after upgrade ubuntu

FYI https://docs.iredmail.org/upgrade.ubunt … 20.04.html

3

Re: Roundcube - can't change password for users after upgrade ubuntu

Thanks for your answer, but it didn't solve my problem.

>Aug 14 15:46:18 mail roundcube: <nd361c6o> DB Error: [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%D,passwordlastchange=NOW() WHERE username='opo4@my.domain'' at line 1

Password hash substitution is not performed instead of %D?

4

Re: Roundcube - can't change password for users after upgrade ubuntu

Problem appears after upgrade Roundcube webmail from 1.5.3 to 1.6.1 or to 1.6.2.

5

Re: Roundcube - can't change password for users after upgrade ubuntu

Solved the problem like this:

root@mail:/opt/www/roundcubemail/plugins# mv ./password{,.old}
root@mail:/opt/www/roundcubemail/plugins# cp -r ~/roundcubemail-1.5.3/plugins/password/ ./
root@mail:/opt/www/roundcubemail/plugins# cp ./password.old/config.inc.php ./password/
root@mail:/opt/www/roundcubemail/plugins# systemctl restart nginx.service

Everything works, thank you