FuzzyOCR 3.5.1 on an ISPConfig 2.2.32 server

Discussion in 'HOWTO-Related Questions' started by Hans, May 11, 2009.

  1. Hans

    Hans Moderator

    I try to install FuzzyOCR 3.5.1 on an ISPConfig 2.2.32 server by following this howto to the letter: http://www.howtoforge.com/fight_image_spam_with_fuzzyocr_spamassassin

    After executing the command: /home/admispconfig/ispconfig/tools/spamassassin/usr/bin/spamassassin --debug FuzzyOcr < /usr/src/FuzzyOcr-3.5.1/samples/ocr-gif.eml > /dev/null

    I get some errors:

    [14495] warn: plugin: failed to parse plugin /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.pm: Can't locate FuzzyOcr/Logging.pm in @INC (@INC contains: /etc/mail/spamassassin /home/admispconfig/ispconfig/tools/spamassassin/usr/share/perl/5.10.0 /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl) at /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.pm line 24.
    [14495] warn: BEGIN failed--compilation aborted at /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.pm line 24.
    [14495] warn: Compilation failed in require at /home/admispconfig/ispconfig/tools/spamassassin/usr/share/perl/5.10.0/Mail/SpamAssassin/PluginHandler.pm line 107.
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_global_wordlist /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.words
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_bin_helper pnmnorm, pnminvert, convert, ppmtopgm, tesseract
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_path_bin /usr/local/netpbm/bin:/usr/local/bin:/usr/bin
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_preprocessor_file /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.preps
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_scanset_file /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.scansets
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_enable_image_hashing 2
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_digest_db /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.hashdb
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_db_hash /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.db
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_db_safe /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.safe.db
    [14495] info: config: failed to parse line, skipping, in "/home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/FuzzyOcr.cf": focr_end_config
    [14495] warn: rules: failed to run FUZZY_OCR_CORRUPT_IMG test, skipping:
    [14495] warn: (Can't locate object method "dummy_check" via package "Mail::SpamAssassin::perMsgStatus" at (eval 659) line 532, <$tmpfile> line 128.
    [14495] warn: )
    [14495] warn: rules: failed to run FUZZY_OCR test, skipping:
    [14495] warn: (Can't locate object method "fuzzyocr_check" via package "Mail::SpamAssassin::perMsgStatus" at (eval 724) line 19.
    [14495] warn: )

    What could be wrong?
     
  2. topdog

    topdog HowtoForge Supporter

    FuzzyOcr/Logging.pm is not in the path, the mail perl module calling it cannot find it.
     
  3. Hans

    Hans Moderator

    Hi Topdog,

    Thanks for your help.
    I thought it had something to do with that path indeed. In the mean time the problem is solved. I must say that i was only able to get it up and running by creating a symlink like this:

    mkdir /etc/mail/
    ln -s /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/ /etc/mail/spamassassin

    Modifying the FuzzyOcr.cf file as described within the howto and leave everything in /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/ did not work for me.

    But, it works now! :)
     
  4. Hans

    Hans Moderator

    Although i've added the words to be scanned into the file FuzzyOcr.words , still some image-spam passes through.

    FuzzyOCR works fine, but it think it's also necesarry to tell Spamassassin to load the FuzzyOCR plugin by doing:

    vi /etc/spamassassin/init.pre

    and insert (at the bottom):
    loadplugin FuzzyOcr /etc/mail/spamassassin/FuzzyOcr.pm

    Correct me if i'm wrong! (it's not mentioned within the howto)
     
  5. topdog

    topdog HowtoForge Supporter

  6. Hans

    Hans Moderator

    Hi Topdog,

    Thanks for your offer to use your rpm. No doubt that it is a great solution, but i can't use it right now.
    The FuzzyOCR anti-image SPAM solution is for an existing Debian Lenny server with ISPConfig 2.2.32.

    I have te impression that the amount of image spam is decreasing now.

    I am new to FuzzyOCR, but do you know if it makes any difference when Caps Lock is off or on, while adding new words to the file FuzzyOcr.words ?
     
  7. topdog

    topdog HowtoForge Supporter

    My bad, i thought you were using a rpm based distro, any way you can get a word list from here http://www.gbnetwork.co.uk/mailscanner/FuzzyOcr.words

    FuzzyOCR is very resource intensive so i suggest you use it as the second line of defense, you should use the sanesecurity clamav signatures as your first defense against image/pdf spam.
     
  8. Hans

    Hans Moderator

    Thanks for the link to the Wordlist and your feedback.
     
  9. Ovidiu

    Ovidiu Active Member

    thats weird.
    I also had loads of imagespam coming through, followed the same tutorial, the test went fine ,teh sample was recognized as spam...

    tried loading fuzzyocr like you suggested: loadplugin FuzzyOcr /etc/mail/spamassassin/FuzzyOcr.pm will see if it changes anything :)
     
  10. Hans

    Hans Moderator

    @Tenaka, same situation here.

    After contacting Falko (the author, of the Howto) and reading this article, i've added the following to the file /etc/mail/spamassassin/v310.pre:

    loadplugin FuzzyOcr /etc/mail/spamassassin/FuzzyOcr.pm
    (at the bottom of the file)

    So, i did not add this line to the file /etc/spamassassin/init.pre.

    Still, sometimes image spam passes the server, although the words to be recognised are within the file file FuzzyOcr.words. So i don't understand.

    What i also don't understand is that within the article some tests are explained. But after giving commands, like:

    spamassassin --lint
    or
    spamassassin -t < animated-gif.eml

    I've got the error: command not found.
     
  11. Ovidiu

    Ovidiu Active Member

    yeah, I just tried that too. will change it from init.pre to v310.pre after work and check again. BUT for me spamassassin --lint does work, end without an error and the sample tests catch the spam so it seems to be working :-(

    the only concern I have is that after amavis-new stop and amavis-new debug-sa the process seems to 'hang' when attempting to create the Berkeley DB and jsut hangs but when I start it again, amavis-new start all is good, no errors and just works...

    I guess your problem is that spamassassin doesn't seem to be in the default path, so try a which spamassassin and run it from taht location? aka /your/path/to/sa --lint ?
     
  12. Hans

    Hans Moderator

    @Tenaka,

    It is just a normal ISPConfig2 server on Debian Lenny, so the path for spamassassin is:
    /home/admispconfig/ispconfig/tools/spamassassin/etc/mail/spamassassin/ right?

    The command: "which spamassassin" give no output at all, (i think, because spamassassin comes with ispconfig and not by Debian).
    But the command: spamassassin --lint can not be found at all.

    You're using ISPConfig2 as well isn't it? From which directory do you execute te command spamassassin --lint ?
     
  13. Ovidiu

    Ovidiu Active Member

    no, I am on ispcfg3 and the command end just fine without any errors..
     
  14. Ovidiu

    Ovidiu Active Member

    weird, after the upgrade to ispcfg3.1.12 FuzzyOcr just started working...
     

Share This Page