PDA

View Full Version : FuzzyOCR 3.5.1 on an ISPConfig 2.2.32 server


Hans
12th May 2009, 00:49
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?

topdog
12th May 2009, 19:10
FuzzyOcr/Logging.pm is not in the path, the mail perl module calling it cannot find it.

Hans
13th May 2009, 01:05
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! :)

Hans
13th May 2009, 14:13
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)

topdog
13th May 2009, 14:15
Oh you could just use my rpm, it does all that for you, http://www.topdog-software.com/oss/fuzzyocr/

Hans
13th May 2009, 20:19
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 ?

topdog
14th May 2009, 11:27
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.

Hans
14th May 2009, 22:59
Thanks for the link to the Wordlist and your feedback.

Tenaka
19th May 2009, 02:12
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 :-)

Hans
19th May 2009, 08:43
@Tenaka, same situation here.

After contacting Falko (the author, of the Howto) and reading this article (http://www200.pair.com/mecham/spam/image_spam_fc5.html), 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 (http://www200.pair.com/mecham/spam/image_spam_fc5.html) 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.

Tenaka
19th May 2009, 09:19
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 ?

Hans
19th May 2009, 09:44
@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 ?

Tenaka
19th May 2009, 11:20
no, I am on ispcfg3 and the command end just fine without any errors..

Tenaka
24th May 2009, 21:23
weird, after the upgrade to ispcfg3.1.12 FuzzyOcr just started working...