Spamassassin installation fails

  • Hi guys


    I just tried to install Spamassassin on my system, but got the following error message:


    An unexpected error occurred:


    Plugin::SpamAssassin::_checkRequirements: The `pyzor` package is not installed on your system
    Plugin::SpamAssassin::_checkRequirements: The `razor` package is not installed on your system



    I disabled the use of razor2 and Pyzor ind the config.php prior the installation of the plugin. I assume this error should not occur as both are optional?


    my system data:
    Debian 8.5i
    MSCP 1.3.0
    Plugins installed: ClamAV, Mailgraph, OpenDKIM, PanelRedirect, Postscreen, RoundcubePlugins)
    PHP: PHP-FPM


    Log shows that:

    Code: Plugin_module_SpamAssassin.log
    1. [Wed Aug 17 19:57:44 2016] [fatal] iMSCP::DbTasksProcessor::_process: Plugin::SpamAssassin::_checkRequirements: The `pyzor` package is not installed on your system at /var/www/imscp/engine/PerlLib/iMSCP/DbTasksProcessor.pm line 447, <$fh> line 370.


    Glad for any help.


    Cheers
    Timo

  • After disabling in the config.php have you updated the plugin list on panels plugin page?

  • I meant in the imscp DB plugins table there's a config column :)

  • Oh, sorry. Here´s thre requested info from the db:


    column plugin_config

    Code
    1. {"use_bayes":"yes","site_wide_bayes":"no","cronjob_bayes_sa-learn":{"minute":"*","hour":"*\/12","day":"*","month":"*","dweek":"*"},"cronjob_clean_bayes_db":{"minute":"@daily","hour":"","day":"","month":"","dweek":""},"use_auto-whitelist":"no","cronjob_clean_awl_db":{"minute":"@daily","hour":"","day":"","month":"","dweek":""},"use_razor2":"no","use_pyzor":"no","use_dcc":"no","use_rbl_checks":"no","use_lang_check":"no","heinlein-support_sa-rules":"yes","DecodeShortURLs":"yes","iXhash2":"yes","markasjunk2":"yes","sauserprefs":"yes","sauserprefs_dont_override":"'{headers}', 'use_razor1', 'bayes_auto_learn_threshold_nonspam', 'bayes_auto_learn_threshold_spam'","spamassMilter_config":{"reject_spam":"-1","check_smtp_auth":"yes","networks":[],"spamassMilterOptions":"-e -f -u spamass-milter","spamassMilterSocket":"\/var\/spool\/postfix\/spamass\/spamass.sock"},"spamassassinOptions":"--max-children=5 --sql-config --nouser-config --username=debian-spamd --port=783 --helper-home-dir=\/var\/lib\/spamassassin"}


    column plugin_config_prev

    Code
    1. {"use_bayes":"yes","site_wide_bayes":"no","cronjob_bayes_sa-learn":{"minute":"*","hour":"*\/12","day":"*","month":"*","dweek":"*"},"cronjob_clean_bayes_db":{"minute":"@daily","hour":"","day":"","month":"","dweek":""},"use_auto-whitelist":"no","cronjob_clean_awl_db":{"minute":"@daily","hour":"","day":"","month":"","dweek":""},"use_razor2":"no","use_pyzor":"no","use_dcc":"no","use_rbl_checks":"no","use_lang_check":"no","heinlein-support_sa-rules":"yes","DecodeShortURLs":"yes","iXhash2":"yes","markasjunk2":"yes","sauserprefs":"yes","sauserprefs_dont_override":"'{headers}', 'use_razor1', 'bayes_auto_learn_threshold_nonspam', 'bayes_auto_learn_threshold_spam'","spamassMilter_config":{"reject_spam":"-1","check_smtp_auth":"yes","networks":[],"spamassMilterOptions":"-e -f -u spamass-milter","spamassMilterSocket":"\/var\/spool\/postfix\/spamass\/spamass.sock"},"spamassassinOptions":"--max-children=5 --sql-config --nouser-config --username=debian-spamd --port=783 --helper-home-dir=\/var\/lib\/spamassassin"}
  • Oh ok problem found. Please try following:

    • Open /backend/SpamAssassin.pm
    • Scroll down to function sub _checkRequirements
    • Replace function with:


    Please give feedback, so I can push this patch :)

  • @Ninos


    If you patch, do not forget to trigger the requirements checks on change (eg, if the admin enable pyzor or razor in the plugin configuration file after the plugin installation).



    Thank you.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hi @Ninos


    I substituted the methode you provide, but now I get the following error:

    Code
    1. An unexpected error occurred: Modules::Plugin::_call: Global symbol "$self" requires explicit package name at /var/www/imscp/gui/plugins/SpamAssassin/backend/SpamAssassin.pm line 1331, <$fh> line 370.Global symbol "$self" requires explicit package name at /var/www/imscp/gui/plugins/SpamAssassin/backend/SpamAssassin.pm line 1332, <$fh> line 370.Compilation failed in require at /var/www/imscp/engine/PerlLib/Modules/Plugin.pm line 349, <$fh> line 370.

    The first code line which causes the error is the following from your method

    Code
    1. next if($_ eq 'pyzor' && $self->{'config'}->{'use_pyzor'} ne 'yes');