Package: php-horde-imp
Version: 6.2.27-3
Severity: important

Dear Maintainer,

In Debian 12 with PHP 8.2, after applying the patch of #1038441, the
"New Message" functionality does not work. This error ir reported:

2024-02-21T09:16:56.181665-03:00 mail HORDE: [imp] ValueError: 
ReflectionMethod::__construct(): Argument #2 ($method) cannot be null when 
argument #1 ($objectOrMethod) is an object in 
/usr/share/php/Horde/Core/Ajax/Application/Handler.php:91
2024-02-21T09:16:56.182079-03:00 mail HORDE: Stack trace:
2024-02-21T09:16:56.182178-03:00 mail HORDE: #0 
/usr/share/php/Horde/Core/Ajax/Application/Handler.php(91): 
ReflectionMethod->__construct()
2024-02-21T09:16:56.182464-03:00 mail HORDE: #1 
/usr/share/php/Horde/Core/Ajax/Application.php(271): 
Horde_Core_Ajax_Application_Handler->has()
2024-02-21T09:16:56.182533-03:00 mail HORDE: #2 
/usr/share/php/Horde/Core/Ajax/Application.php(84): 
Horde_Core_Ajax_Application->_getHandler()
2024-02-21T09:16:56.182956-03:00 mail HORDE: #3 
/usr/share/php/Horde/Core/Factory/Ajax.php(44): 
Horde_Core_Ajax_Application->__construct()
2024-02-21T09:16:56.183035-03:00 mail HORDE: #4 
/usr/share/horde/imp/lib/Dynamic/Compose.php(239): 
Horde_Core_Factory_Ajax->create()
2024-02-21T09:16:56.183375-03:00 mail HORDE: #5 
/usr/share/horde/imp/lib/Dynamic/Base.php(90): IMP_Dynamic_Compose->_init()
2024-02-21T09:16:56.183700-03:00 mail HORDE: #6 
/usr/share/horde/imp/dynamic.php(33): IMP_Dynamic_Base->__construct()
2024-02-21T09:16:56.184444-03:00 mail HORDE: #7 {main} [pid 15960 on line 74 of 
"/usr/share/php/Horde/ErrorHandler.php"]

This error can be fixed by patching the file
/usr/share/php/Horde/Core/Ajax/Application/Handler.php
with the changes of
https://github.com/horde/Core/commit/53f0ab007e0fbf80a2350fc995815253d95b7fd5
(only that file):

diff --git a/lib/Horde/Core/Ajax/Application/Handler.php 
b/lib/Horde/Core/Ajax/Application/Handler.php
index 8826b12b..011a5805 100644
--- a/lib/Horde/Core/Ajax/Application/Handler.php
+++ b/lib/Horde/Core/Ajax/Application/Handler.php
@@ -87,6 +87,9 @@ class Horde_Core_Ajax_Application_Handler
      */
     final public function has($action)
     {
+        if (empty($action)) {
+            return false;
+        }
         try {
             $method = new ReflectionMethod($this, $action);
         } catch (ReflectionException $e) {

(This file actually belongs to php-horde-core.)

This allows the user to open the new mail window, edit and send the mail, but
there's still a problem: an error ("Error when communicating with the server")
is returned, even though the mail is sent. Unfortunately, nothing is logged
in this case.

The call to /horde/services/ajax.php/imp/sendMessage return 500, and it's
reply is:

/*-secure-{"response":{"action":"sendMessage","success":1},"msgs":[{"message":"Message
 \"Teste\" sent successfully.","type":"horde.success"}]}*/

So while it indicates success, the whole object is commented and has that
'-secure-' tag before. I've not been able to identify the cause of this
error.

It seems that development of Horde has restarted, and there are some alpha
versions, mostly just fixing PHP compatibility bugs. While in general packaging
alpha versions might not be a great idea, in this case I think it might be
useful to do so, since Horde is essentially unusable in Debian 12.


-- System Information:
Debian Release: 12.5
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-18-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages php-horde-imp depends on:
ii  libapache2-mod-php8.2 [php-json]  8.2.7-1~deb12u1
ii  php-cli                           2:8.2+93
ii  php-common                        2:93
ii  php-horde                         5.2.23+debian0-6
ii  php-horde-auth                    2.2.2-10
ii  php-horde-browser                 2.0.16-5
ii  php-horde-cache                   2.5.5-11
ii  php-horde-compress                2.2.4-3
ii  php-horde-core                    2.31.18+debian0-2
ii  php-horde-crypt                   2.7.12-9
ii  php-horde-css-parser              1.0.11-8
ii  php-horde-date                    2.4.1-9
ii  php-horde-editor                  2.0.5+debian0-5
ii  php-horde-exception               2.0.8-10
ii  php-horde-icalendar               2.1.8-7
ii  php-horde-image                   2.6.1-2
ii  php-horde-imap-client             2.30.6-3
ii  php-horde-itip                    2.1.2-9
ii  php-horde-listheaders             1.2.5-7
ii  php-horde-logintasks              2.0.8-1
ii  php-horde-mail                    2.6.6-5
ii  php-horde-mail-autoconfig         1.0.3-10
ii  php-horde-mime                    2.11.2-2
ii  php-horde-mime-viewer             2.2.4+debian0-2
ii  php-horde-nls                     2.2.1-6
ii  php-horde-notification            2.0.4-10
ii  php-horde-pack                    1.0.7-7
ii  php-horde-perms                   2.1.8-5
ii  php-horde-spellchecker            2.1.3-9
ii  php-horde-stream                  1.6.3-10
ii  php-horde-stream-filter           2.0.5-1
ii  php-horde-stream-wrapper          2.1.5-1
ii  php-horde-support                 2.2.2-2
ii  php-horde-text-filter             2.3.7-1
ii  php-horde-text-flowed             2.0.4-3
ii  php-horde-tree                    2.0.5-6
ii  php-horde-url                     2.2.6-9
ii  php-horde-util                    2.5.12-2
ii  php-horde-vfs                     2.4.2-1
ii  php-horde-view                    2.0.6-10
ii  php-json                          2:8.2+93
ii  php-xml                           2:8.2+93
ii  php8.2-cgi [php-json]             8.2.7-1~deb12u1
ii  php8.2-cli [php-json]             8.2.7-1~deb12u1
ii  php8.2-xml [php-xml]              8.2.7-1~deb12u1

Versions of packages php-horde-imp recommends:
ii  php-horde-history                     2.3.6-11
ii  php-horde-http                        2.1.7-11
pn  php-horde-service-gravatar            <none>
ii  php-seclib [php-phpseclib-file-asn1]  1.0.20-1+deb12u1

php-horde-imp suggests no packages.

-- Configuration Files:
/etc/horde/imp/.htaccess [Errno 13] Permission denied: 
'/etc/horde/imp/.htaccess'
/etc/horde/imp/backends.php [Errno 13] Permission denied: 
'/etc/horde/imp/backends.php'
/etc/horde/imp/conf.xml [Errno 13] Permission denied: '/etc/horde/imp/conf.xml'
/etc/horde/imp/hooks.php.dist [Errno 13] Permission denied: 
'/etc/horde/imp/hooks.php.dist'
/etc/horde/imp/menu.php.dist [Errno 13] Permission denied: 
'/etc/horde/imp/menu.php.dist'
/etc/horde/imp/mime_drivers.php [Errno 13] Permission denied: 
'/etc/horde/imp/mime_drivers.php'
/etc/horde/imp/prefs.php [Errno 13] Permission denied: 
'/etc/horde/imp/prefs.php'

-- no debconf information

Reply via email to