FreeBSD Install FuzzyOCR To Detect Image Spam

How do I install FuzzyOcr plugin for SpamAssassin to detect unsolicited bulk mail (Spam) containing images as the main content for Postfix mail server?

ADVERTISEMENTS

FuzzyOcr uses different methods to analyzes the content and properties of images to distinguish between normal mails (Ham) and spam mails. FuzzyOcr can detect many types of image spam and can protect your server and users from spammers easily.

How do Install FuzzyOCR on FreeBSD?

First, update ports tree, enter:
# portsnap fetch update
Now, install FuzzyOCR, type:
# cd /usr/ports/mail/p5-FuzzyOcr-devel
# make install clean

Copy FuzzyOcr config and words files to SpamAssassin configuration directory, type:
# cp /usr/local/share/examples/FuzzyOcr/FuzzyOcr.* /usr/local/etc/mail/spamassassin
Open /usr/local/etc/mail/spamassassin/init.pre file, enter:
# vi /usr/local/etc/mail/spamassassin/init.pre
Add following line to enable FuzzyOcr, enter:

# FuzzyOcr
loadplugin Mail::SpamAssassin::Plugin::FuzzyOcr

Open /usr/local/etc/mail/spamassassin/FuzzyOcr.cf, enter:
# vi /usr/local/etc/mail/spamassassin/FuzzyOcr.cf
Make sure you set focr_logfile to /var/log/FuzzyOcr.log, enter:
focr_logfile /var/log/FuzzyOcr.log
Save and close the file. Restart your anti spam gateway engine such as mailscanner:
# /usr/local/etc/rc.d/mailscanner restart
NOTE: If you are not using mailscanner, restart sa-spamd:
# /usr/local/etc/rc.d/sa-spamd restart

How do I test if FuzzyOCR is working or not?

Simply download test sample spam email images from the official website. Or try following commands:
# cd /tmp
# mkdir test;cd test
# fetch http://users.own-hero.net/~decoder/fuzzyocr/sample-mails.tar.gz
# tar -zxvf sample-mails.tar.gz
# spamassassin -t < ocr-gif.eml

You can also see log in /var/log/maillog and /var/log/FuzzyOcr.log files:
# tail -f /var/log/FuzzyOcr.log
# tail -f /var/log/maillog

Recommend readings:

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
3 comments… add one
  • Fedora 8 apache service and any other services are unbale to access from any other (windows/linux)machine in the network. Jan 30, 2009 @ 6:18

    Fedora 8 apache service and any other services are unbale to access from any other (windows/linux)machine in the network. Please can anybody help me regarding.

  • slv Dec 20, 2009 @ 18:19

    hi,

    nice howto! but your simple test got mistake:

    # unzip sample-mails.tar.gz

    really unzip? ;)

    s.

  • 🐧 nixCraft Dec 20, 2009 @ 19:11

    Heh

    Thanks for the heads up!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.