Roundcube refuses to send attachments anymore

Discussion in 'Plugins/Modules/Addons' started by electronico_nc, Jan 10, 2024.

  1. Hi all,

    Ubuntu 22 server
    Apache 2.4.52
    Several PHP versions installed through Ondrev repos PHP8.1 by default
    ISPConfig 3.2.11p1 (standalone)
    Roundcube 1.5.3

    All was running OK before ispconfig_update.sh (3.2.11 to 3.2.11p1) and a server reboot (was a 30 days uptime)

    1. Now roundcube run as usual EXCEPT it can't send attachment in email anymore (even a 100Ko file)

    I tried complete re-installation from roundcube 1.5.3 (tried from 1.5.0, 1.5.6 and 1.6.5 too) : problem is always still there

    Here are some infos about versions and errors:
    Code:
    cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=22.04
    DISTRIB_CODENAME=jammy
    DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
    Code:
    uname -a
    Linux changed.net 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
    Code:
    update-alternatives --config php
      Sélection   Chemin           Priorité  État
    ------------------------------------------------------------
      0            /usr/bin/php8.2   82        mode automatique
      1            /usr/bin/php5.6   56        mode manuel
      2            /usr/bin/php7.1   71        mode manuel
      3            /usr/bin/php7.2   72        mode manuel
      4            /usr/bin/php7.3   73        mode manuel
      5            /usr/bin/php7.4   74        mode manuel
      6            /usr/bin/php8.0   80        mode manuel
    * 7            /usr/bin/php8.1   81        mode manuel
      8            /usr/bin/php8.2   82        mode manuel
    Code:
    update-alternatives --config php-cgi
      Sélection   Chemin               Priorité  État
    ------------------------------------------------------------
      0            /usr/bin/php-cgi8.1   81        mode automatique
      1            /usr/bin/php-cgi5.6   56        mode manuel
      2            /usr/bin/php-cgi7.1   71        mode manuel
      3            /usr/bin/php-cgi7.3   73        mode manuel
      4            /usr/bin/php-cgi7.4   74        mode manuel
      5            /usr/bin/php-cgi8.0   80        mode manuel
    * 6            /usr/bin/php-cgi8.1   81        mode manuel
      7            /usr/bin/php5-cgi     50        mode manuel
    Code:
    update-alternatives --config php-fpm.sock
      Sélection   Chemin                    Priorité  État
    ------------------------------------------------------------
      0            /run/php/php8.1-fpm.sock   81        mode automatique
      1            /run/php/php5.6-fpm.sock   56        mode manuel
      2            /run/php/php7.1-fpm.sock   71        mode manuel
      3            /run/php/php7.3-fpm.sock   73        mode manuel
      4            /run/php/php7.4-fpm.sock   74        mode manuel
      5            /run/php/php8.0-fpm.sock   80        mode manuel
    * 6            /run/php/php8.1-fpm.sock   81        mode manuel
    Code:
    pear list -a
    Installed packages, channel __uri:
    ==================================
    (no packages installed)
    
    Installed packages, channel doc.php.net:
    ========================================
    (no packages installed)
    
    Installed packages, channel pear.php.net:
    =========================================
    Package          Version State
    Archive_Tar      1.4.14  stable
    Auth_SASL        1.1.0   stable
    Console_Getopt   1.4.3   stable
    Mail             1.6.0   stable
    Mail_Mime        1.10.11 stable
    Net_SMTP         1.10.0  stable
    Net_Sieve        1.4.5   stable
    Net_Socket       1.2.2   stable
    PEAR             1.10.13 stable
    PEAR_Manpages    1.10.0  stable
    Structures_Graph 1.1.1   stable
    XML_Util         1.4.5   stable
    
    Installed packages, channel pecl.php.net:
    =========================================
    Package   Version State
    imagick   3.1.2   stable
    memcache  3.0.8   beta
    memcached 2.1.0   stable
    Code:
    cat /var/lib/roundcube/config/config.inc.php
    <?php
    /* Local configuration for Roundcube Webmail */
    $config['imap_host'] = 'localhost:143';
    $config['smtp_host'] = 'localhost:25';
    // ----------------------------------
    // SQL DATABASE
    // ----------------------------------
    // Database connection string (DSN) for read+write operations
    // Format (compatible with PEAR MDB2): db_provider://user:password@host/database
    // Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
    // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
    // NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
    //       or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
    $config['db_dsnw'] = 'mysql://roundcube:UMFhsQhHs63qY@localhost/roundcube';
    // Log sent messages to <log_dir>/sendmail or to syslog
    $config['smtp_log'] = false;
    // $config['default_host'] = 'tls://localhost';
    // $config['smtp_user'] = '%u';
    // $config['smtp_pass'] = '%p';
    // SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
    // $config['smtp_port'] = 587;
    // provide an URL where a user can get support for this Roundcube installation
    // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
    $config['support_url'] = '';
    // automatically create a new Roundcube user when log-in the first time.
    // a new user will be created once the IMAP login succeeds.
    // set to false if only registered users can use this service
    $config['auto_create_user'] = false;
    // use this folder to store log files (must be writeable for apache user)
    // This is used by the 'file' log driver.
    $config['log_dir'] = 'logs/';
    // use this folder to store temp files (must be writeable for apache user)
    $config['temp_dir'] = 'temp/';
    // this key is used to encrypt the users imap password which is stored
    // in the session record (and the client cookie if remember password is enabled).
    // please provide a string of exactly 24 chars.
    $config['des_key'] = 'RYXzMEb[hcPLoN7hVqnu4Ql]';
    // ----------------------------------
    // PLUGINS
    // ----------------------------------
    // List of active plugins (in plugins/ directory)
    // $rcmail_config['plugins'] = array();
    $config['plugins'] = ['jqueryui', 'ispconfig3_account', 'ispconfig3_autoreply', 'ispconfig3_pass', 'ispconfig3_spam', 'ispconfig3_fetchmail', 'ispconfig3_filter', 'ispconfig3_forward'];
    // the default locale setting (leave empty for auto-detection)
    // RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
    $config['language'] = 'fr_FR';
    // Make use of the built-in spell checker. It is based on GoogieSpell.
    $config['enable_spellcheck'] = false;
    // Set the spell checking engine. 'googie' is the default. 'pspell' is also available,
    // but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here.
    $config['spellcheck_engine'] = 'pspell';
    // ----------------------------------
    // USER PREFERENCES
    // ----------------------------------
    // Use this charset as fallback for message decoding
    $config['default_charset'] = 'UTF-8';
    // skin name: folder from skins/
    //$rcmail_config['skin'] = 'larry';
    $config['skin'] = 'classic';
    // prefer displaying HTML messages
    $config['prefer_html'] = false;
    // lifetime of message cache
    // possible units: s, m, h, d, w
    $config['message_cache_lifetime'] = '10d';
    // display these folders separately in the mailbox list.
    // these folders will also be displayed with localized names
    // NOTE: Use folder names with namespace prefix (INBOX. on Courier-IMAP)
    $config['default_folders'] = ['INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'];
    // you can define specific table names used to store webmail data
    $config['db_table_users'] = 'users';
    $config['db_table_identities'] = 'identities';
    $config['db_table_contacts'] = 'contacts';
    $config['db_table_contactgroups'] = 'contactgroups';
    $config['db_table_contactgroupmembers'] = 'contactgroupmembers';
    $config['db_table_session'] = 'session';
    $config['db_table_cache'] = 'cache';
    $config['db_table_cache_index'] = 'cache_index';
    $config['db_table_cache_thread'] = 'cache_thread';
    $config['db_table_cache_messages'] = 'cache_messages';
    $config['db_table_dictionary'] = 'dictionary';
    $config['db_table_searches'] = 'searches';
    $config['db_table_system'] = 'system';
    // you can define specific sequence names used in PostgreSQL
    $config['db_sequence_users'] = 'user_ids';
    $config['db_sequence_identities'] = 'identity_ids';
    $config['db_sequence_contacts'] = 'contact_ids';
    $config['db_sequence_contactgroups'] = 'contactgroups_ids';
    $config['db_sequence_searches'] = 'search_ids';

    When trying to send an attachment :
    Code:
    tail -f /var/log/roundcube/errors.log
    [10-Jan-2024 09:04:31 UTC] PHP Warning:  Undefined array key "larry" in /var/lib/roundcube/plugins/jqueryui/jqueryui.php on line 39
    [10-Jan-2024 09:04:31 UTC] PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/lib/roundcube/vendor/pear/mail_mime/Mail/mime.php on line 1372
    [10-Jan-2024 09:04:31 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function get_magic_quotes_runtime() in /var/lib/roundcube/vendor/pear/mail_mime/Mail/mime.php:497
    Stack trace:
    #0 /var/lib/roundcube/vendor/pear/mail_mime/Mail/mime.php(428): Mail_mime->file2str()
    #1 /usr/share/roundcube/program/actions/mail/send.php(419): Mail_mime->addAttachment()
    #2 /usr/share/roundcube/program/actions/mail/send.php(219): rcmail_action_mail_send::add_attachments()
    #3 /usr/share/roundcube/program/include/rcmail.php(282): rcmail_action_mail_send->run()
    #4 /usr/share/roundcube/index.php(278): rcmail->action_handler()
    #5 {main}
      thrown in /var/lib/roundcube/vendor/pear/mail_mime/Mail/mime.php on line 497
    I run out of ideas to diag this.
    Thanks a lot for your thought !

    Nicolas
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely, you accidentally changed the system PHP version to, e.g., PHP 8.3, which is not supported by that RoundCube version; neither an ISPConfig update nor a system reboot can cause that. Most likely you ran and apt upgrade command, which caused the issue. It might be that you have mod_php installed and RoundCube runs as mod_php but with a wrong PHP version like 8.3
     
    ahrasis and electronico_nc like this.
  3. Thanks for your answer Till !

    Yes, there has been apt upgrade command
    Some php8.3 files where installed
    Code:
    apt list *php8.3* --installed
    En train de lister... Fait
    php8.3-common/jammy,now 8.3.1-1+ubuntu22.04.1+deb.sury.org+1 amd64  [installé, automatique]
    php8.3-pspell/jammy,now 8.3.1-1+ubuntu22.04.1+deb.sury.org+1 amd64  [installé, automatique]
    They have been removed:
    Code:
    apt remove --purge php8.3-common php8.3-pspell
    Error was still there...

    Had a look at serveur config :
    Server config / PHP settings
    All values were set to PHP7.4 => changed to 8.1

    Problem solved !!

    Thanks again Till for the track !
     

Share This Page