pimlie / authres_status

Roundcube plugin that checks the Authentication-Results headers (rfc5451) of your emails and displays the verification status.
Other
34 stars 20 forks source link

Class 'DKIM_Verify' not found #49

Open kutmaster opened 3 years ago

kutmaster commented 3 years ago

[30-Jul-2020 17:38:18 PHP Fatal error: Uncaught Error: Class 'DKIM_Verify' not found in /var/www/roundcube/plugins/authres_status/authres_status.php:435 Stack trace:

0 /var/www/roundcube/plugins/authres_status/authres_status.php(215): authres_status->get_authentication_status()

1 /var/www/roundcube/program/lib/Roundcube/rcube_plugin_api.php(469): authres_status->messages_list()

2 /var/www/roundcube/program/steps/mail/func.inc(444): rcube_plugin_api->exec_hook()

3 /var/www/roundcube/program/steps/mail/list.inc(109): rcmail_js_message_list()

4 /var/www/roundcube/index.php(306): include_once('/var/www/apps/r...')

5 {main}

thrown in /var/wwwroundcube/plugins/authres_status/authres_status.php on line 435

Using authres_status v0.6.1 and roundcube 1.4.7

pimlie commented 3 years ago

Could maybe be caused by a missing "minimum_stability": "dev" in your composer.json? See this repo for the requirements of the php-dkim package: https://github.com/pimlie/php-dkim

PenelopeFudd commented 3 years ago

Hi; I'm getting a similar error:

[Tue Mar 16 23:22:42.559435 2021] [proxy_fcgi:error] [pid 22749:tid 140036024542976] [client 172.103.241.96:36248] AH01071: Got error '
PHP message: __DIR__=/usr/share/roundcubemail/plugins/authres_status
PHP message: autoload=1
PHP message: PHP Fatal error:  Uncaught Error: Call to a member function loadClass() on integer in /usr/share/roundcubemail/plugins/authres_status/authres_status.php:434
Stack trace:
#0 /usr/share/roundcubemail/plugins/authres_status/authres_status.php(216): authres_status->get_authentication_status(Object(rcube_message_header), 126, 1278)
#1 /usr/share/roundcubemail/program/lib/Roundcube/rcube_plugin_api.php(440): authres_status->messages_list(Array)
#2 /usr/share/roundcubemail/program/steps/mail/func.inc(447): rcube_plugin_api->exec_hook('messages_list', Array)
#3 /usr/share/roundcubemail/program/steps/mail/search.inc(169): rcmail_js_message_list(Array, false)
#4 /usr/share/roundcubemail/index.php(303): include_once('/usr/share/roun...')
#5 {main}
  thrown in /usr/share/roundcubemail/plugins/authres_status/authres_status.php on line 434
', referer: https://www.pkts.ca/roundcubemail/?_task=mail&_mbox=INBOX

Note: I added a couple of print statements to show what DIR and $autoload were returning:

                if ($uid) {
                    $rcmail = rcmail::get_instance();
                    if ($headers->others['dkim-signature'] && $rcmail->config->get('use_fallback_verifier')) {
                        if (!class_exists('Crypt_RSA')) {
                            error_log(sprintf('__DIR__=%s',__DIR__));
                            $autoload = require __DIR__ . "/../../vendor/autoload.php";
                            error_log(sprintf('autoload=%s',$autoload));
                            $autoload->loadClass('Crypt_RSA'); // Preload for use in DKIM_Verify
                        }

                        try {
                          $dkimVerify = new DKIM_Verify($rcmail->imap->get_raw_body($uid));

The require function is returning the number '1' (E_ERROR) instead of an object. Apparently __autoload has been deprecated.

At any rate, a solution is visible in the code snippet shown above: setting 'use_fallback_verifier' to false in the configuration file will skip the problem, at the expense of not cryptographically verifying dkim-signatures.

PenelopeFudd commented 3 years ago

Sigh. I set 'use_fallback_verifier' to false, and the error went away, but now the message status column isn't shown in the search results.