debian/0000755000000000000000000000000012146266716007201 5ustar debian/watch0000644000000000000000000000003712146266716010232 0ustar # No known upstream repository debian/rules0000755000000000000000000000325012146266716010261 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # This file is public domain software, originally written by Joey Hess. # # This version is for packages that are architecture independent. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 package=fuzzyocr destdir=/usr/share/perl5 build-arch: build-indep: build: build-stamp build-stamp: dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs # Add here commands to install the package into debian/. mkdir --parents `pwd`/debian/$(package)/$(destdir) cp FuzzyOcr.pm `pwd`/debian/$(package)/$(destdir)/ cp -a FuzzyOcr `pwd`/debian/$(package)/$(destdir)/ mkdir --parents `pwd`/debian/$(package)/etc/spamassassin cp FuzzyOcr.words FuzzyOcr.scansets FuzzyOcr.preps `pwd`/debian/$(package)/etc/spamassassin #by this trick, when the package is removed but not purged, # the symlink will disappear and spamassassin will ignore the real conf file cp FuzzyOcr.cf `pwd`/debian/$(package)/etc/spamassassin/FuzzyOcr.cf.real ln -s FuzzyOcr.cf.real `pwd`/debian/$(package)/etc/spamassassin/FuzzyOcr.cf # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installchangelogs CHANGES dh_installdocs Utils dh_installexamples samples/* dh_installman dh_link dh_compress -X.eml -XUtils dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/control0000644000000000000000000000244712146266716010613 0ustar Source: fuzzyocr Section: mail Priority: extra Maintainer: Francois Marier Build-Depends: debhelper (>= 9) Standards-Version: 3.9.4 Homepage: http://fuzzyocr.own-hero.net/ Vcs-Git: git://git.debian.org/git/collab-maint/fuzzyocr.git Vcs-Browser: http://git.debian.org/?p=collab-maint/fuzzyocr.git;a=summary Package: fuzzyocr Architecture: all Depends: ${misc:Depends}, spamassassin, tesseract-ocr-eng, gocr, ocrad, netpbm, giflib-tools, gifsicle, libstring-approx-perl, libdigest-md5-perl, libmldbm-sync-perl, libtie-cache-perl, libdbd-mysql-perl Description: spamassassin plugin to check image attachments This Spamassassin plugin checks for specific keywords in image/gif, image/jpeg or image/png attachments, using gocr (an optical character recognition program). This plugin can be used to detect spam that puts all the real spam content in an attached image, while the mail itself is only random text and random html, without any URL's or identifiable information. Additionally to the normal OcrPlugin, it can do approximate matches on words, so errors in recognition or attempts to obfuscate the text inside the image will not cause the detection to fail. . This is a development version from SVN. Currently, this SVN version is the only one that works with spamassassin 3.2. debian/README.Debian0000644000000000000000000000602012146266716011240 0ustar fuzzyocr for Debian ------------------- --- config file The main config file is installed in /etc/spamassassin/FuzzyOcr.cf.real When the package is installed, there is a symlink FuzzyOcr.cf -> FuzzyOcr.cf.real (so, when the package is removed, but not purged, then the symlink is absent, and spamassassin does not try to initialize the plugin). --- spamc/spamd In the main config file, the settings for focr_logfile and focr_digest_db do not make sense when an user is using spamc/spamd (as I do). Currently both are then disabled. This way, FuzzyOcr works out-of-the-box with spamc/spamd It is still possible, though, for an user to use those features; for example, I added into /home/debdev/.spamassassin/user_prefs focr_verbose 2 focr_logfile /home/debdev/var/FuzzyOcr.log focr_enable_image_hashing 1 focr_digest_db /home/debdev/var/FuzzyOcr.hashdb -- A Mennucc1 , Sun, 28 Sep 2008 09:26:50 +0200 This following is an upstream introduction to FuzzyOcr: FuzzyOcr is a plugin for SpamAssassin which is aimed at unsolicited bulk mail (also known as "Spam") containing images as the main content carrier. Using different methods, it analyzes the content and properties of images to distinguish between normal mails (Ham) and spam mails. The methods mainly are: * Optical Character Recognition using different engines and settings * Fuzzy word matching algorithm applied to OCR results * Image hashing system to learn unique properties of known spam images * Dimension, size and integrity checking of images * Content-Type verification for the containing email For a brief description of features, resource aspects and scalability, see the detailed list below: * Matching and learning techniques o Flexible Optical Character Recognition interface + Official Support for gocr and ocrad + Generic support for TesserAct and others upcoming (planned for 3.5) o Fuzzy word matching algorithm applied to OCR results o Recognition of duplicate (already processed) or similar images using feature vectors (Hashing) + Efficient MLDBM database + Mysql Support (planned for 3.5) o Dimension, size and integrity checking o Content-Type checking of containing email * Resource saving techniques o Only scan mails which where not recognized yet as Ham or Spam by other SpamAssassin rules or plugins (using score thresholds) o Optional skip of other scanning facilities once one scores already with a given threshold (planned for 3.5) o Mail skipping based on direct feature analysis (Dimensions and file size) (planned for 3.5) * Safety measures o Configurable timeout against Denial of Service attacks against the third party tools o Context based word sets instead of simple lists to prevent false positives (planned for 3.5) debian/changelog0000644000000000000000000001233312146266716011055 0ustar fuzzyocr (3.6.0-8) unstable; urgency=low * debian/watch: remove upstream source that disappeared * debian/copyright: convert to machine-readable format * Bump Standards-Version up to 3.9.4 -- Francois Marier Mon, 20 May 2013 12:13:17 +1200 fuzzyocr (3.6.0-7) unstable; urgency=low * Bump debhelper compatibility to 9 * Bump Standards-Version up to 3.9.3 -- Francois Marier Mon, 28 May 2012 22:49:03 +1200 fuzzyocr (3.6.0-6) unstable; urgency=low * Add missing "delete" to fix warnings in PDF scans (closes: #634009) Thanks to Gerald Turner for the patch! * Bump Standards-Version up to 3.9.2 * Add empty "build-arch" and "build-indep" targets to debian/rules * Remove unnecessary dh_make template comments from debian/watch -- Francois Marier Fri, 15 Jul 2011 16:18:47 -0700 fuzzyocr (3.6.0-5) unstable; urgency=low * Depend on gocr, ocrad and tesseract (closes: #619613) * Remove unnecessary versioned dependency on spamassassin * Remove obsolete conflict -- Francois Marier Sat, 26 Mar 2011 11:50:04 +1300 fuzzyocr (3.6.0-4) unstable; urgency=low * Bump Standards-Version up to 3.9.1 * Bump debhelper compatibility to 8 -- Francois Marier Wed, 22 Dec 2010 16:28:13 +1300 fuzzyocr (3.6.0-3) unstable; urgency=low * Extend the untaint patch (closes: #568233) -- Francois Marier Tue, 18 May 2010 21:35:27 +1200 fuzzyocr (3.6.0-2) unstable; urgency=low * Apply patch to untaint ocr helpers (closes: #571218, #568560) Thanks to Arjan and Martin for the patches! -- Francois Marier Fri, 14 May 2010 14:08:37 +1200 fuzzyocr (3.6.0-1) unstable; urgency=low * New upstream release * Adopt this package (closes: #578828) * Acknowledge NMUs (closes: #540459, #522285, #525413, #500950, #528728) * Bump Standards-Version to 3.8.4 * Bump debhelper compatibility to 7 (and use dh_prep in debian/rules) * Switch to 3.0 (quilt) source package format * Add git vcs fields to debian/control * Add dependency on ${misc:Depends} (lintian warning) -- Francois Marier Mon, 03 May 2010 16:58:08 +1200 fuzzyocr (3.5.1+svn135-1.2) unstable; urgency=low * Non-maintainer upload. * giflib provided a transitional package for libungif-bin and reduced it to a simple provides now. As versioned dependencies on provided packages do not work, move the dependency over to giflib-tools. (Closes: #540459) -- Philipp Kern Sat, 22 Aug 2009 14:28:36 +0200 fuzzyocr (3.5.1+svn135-1.1) unstable; urgency=low * Non-maintainer upload. * Fix perl warning causing problems in FuzzyOcr preprocessor (closes: #522285, #525413) * Redo maintainer scripts from debhelper templates and split the postinst into a preinst and a postinst (closes: #500950) * Add homepage field in debian/control * Bump Standards-Version up to 3.8.1 * Cleanup debian/copyright to fix lintian warnings * Fix watch file to demangle upstream and debian versions -- Francois Marier Fri, 08 May 2009 12:46:29 +1200 fuzzyocr (3.5.1+svn135-1) unstable; urgency=low * This version works with spamassassin 3.2 (Closes: #500426) * Upgrade to svn135 (Closes: #406396) * Repair watch file (Closes: #449770) * Depends on tesseract-ocr | gocr | ocrad, * patches to use tesseract (Closes: #481383). * Depend on libtie-cache-perl, libdbd-mysql-perl to avoid warnings in /var/log/mail.warn ; do not print warnings regarding missing executables in normal mode, but only in debug mode (Closes: #407992) * Up standard to 3.8.0 * Do not use pamthreshold, pamtopnm (they are not available in Debian) * Do not ship full Apache license in copyright -- A Mennucc1 Sun, 28 Sep 2008 10:08:24 +0200 fuzzyocr3 (3.5.1-2) experimental; urgency=low * - Add upstream changelog. - Add samples to /usr/share/doc/fuzzyocr3/examples. - Add Utils to /usr/share/doc/fuzzyocr3/Utils. thanks to gregor herrmann (Closes: #406663) * do not use pam* stuff, (unavailable in netpbm, due to lack of license), thanks to Alexander Elbs (Closes: #406626) & thanks Gary V for the patches -- A Mennucc1 Wed, 17 Jan 2007 10:35:19 +0100 fuzzyocr3 (3.5.1-1) experimental; urgency=low * New upstream release -- A Mennucc1 Sun, 7 Jan 2007 17:07:33 +0100 fuzzyocr (2.3b-2) unstable; urgency=low * Bug fix: "fuzzyocr: Misleading error message", thanks to Adam Porter (Closes: #404632). * Bug fix: "fuzzyocr: Perl module path is hardcoded", thanks to Adam Porter (Closes: #404627); and also * FuzzyOcr.cf : set focr_global_wordlist to /etc/spamassassin/FuzzyOcr.words thanks to Michael Holtermann * added "portfolio" to sample spam words -- A Mennucc1 Sat, 6 Jan 2007 10:01:26 +0100 fuzzyocr (2.3b-1) unstable; urgency=low * Initial release (Closes: #397615) * Attention: the gocr binary has a bug which can cause segfaults with specific images. This may turn out to be a security threat. Use this sw with caution. -- A Mennucc1 Thu, 30 Nov 2006 11:13:32 +0100 debian/copyright0000644000000000000000000000376312146266716011145 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: fuzzyocr Files: * Copyright: 2006-2008 Christian Holler and Jorge Valdes License: Apache Files: debian/* Copyright: 2009-2013 Francois Marier License: Apache Files: debian/* Copyright: 2006-2008 A Mennucc1 License: GPL License: Apache Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the complete text of the Apache License Version 2.0 can be found in /usr/share/common-licenses/Apache-2.0 . License: GPL This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL . debian/preinst0000644000000000000000000000144612146266716010615 0ustar #!/bin/sh # preinst script for fuzzyocr # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in install|upgrade) if [ -x "/etc/init.d/spamassassin" ]; then invoke-rc.d spamassassin stop || exit $? fi ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/postinst0000644000000000000000000000206212146266716011007 0ustar #!/bin/sh # postinst script for fuzzyocr # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) if [ -x "/etc/init.d/spamassassin" ]; then invoke-rc.d spamassassin start || exit $? fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/source/0000755000000000000000000000000012146266716010501 5ustar debian/source/format0000644000000000000000000000001412146266716011707 0ustar 3.0 (quilt) debian/postrm0000644000000000000000000000204612146266716010452 0ustar #!/bin/sh # postrm script for fuzzyocr # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove) if [ -x "/etc/init.d/spamassassin" ]; then invoke-rc.d spamassassin restart || exit $? fi ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/patches/0000755000000000000000000000000012146266716010630 5ustar debian/patches/fix_tesseract_0000644000000000000000000000244112146266716013556 0ustar Index: fuzzyocr-3+svn135/FuzzyOcr/Preprocessor.pm =================================================================== --- fuzzyocr-3+svn135.orig/FuzzyOcr/Preprocessor.pm 2008-09-28 11:12:08.000000000 +0200 +++ fuzzyocr-3+svn135/FuzzyOcr/Preprocessor.pm 2008-09-28 11:18:12.000000000 +0200 @@ -32,6 +32,10 @@ my $tmpdir = FuzzyOcr::Config::get_tmpdir(); my $label = $self->{label}; my $output = "$tmpdir/prep.$label.out"; + + if ($label eq "maketiff") { + $output = "$tmpdir/prep.$label.tif"; + } my $stderr = ">$tmpdir/prep.$label.err"; my $stdin = undef; Index: fuzzyocr-3+svn135/FuzzyOcr/Scanset.pm =================================================================== --- fuzzyocr-3+svn135.orig/FuzzyOcr/Scanset.pm 2008-09-28 11:15:30.000000000 +0200 +++ fuzzyocr-3+svn135/FuzzyOcr/Scanset.pm 2008-09-28 11:19:07.000000000 +0200 @@ -80,7 +80,12 @@ return ($retcode,@result); } # Input of next processor is output of last - $input = "$tmpdir/prep.$plabel.out"; + # Output name of maketiff is special! + if ($plabel eq "maketiff") { + $input = "$tmpdir/prep.$plabel.tif"; + } else { + $input = "$tmpdir/prep.$plabel.out"; + } } } debian/patches/series0000644000000000000000000000016512146266716012047 0ustar general netpbm-DFSG fix_tesseract_ enable-tesseract silence_log untaint_ocr_helper.patch skippdf_missingdelete.patch debian/patches/enable-tesseract0000644000000000000000000000156012146266716013776 0ustar Index: fuzzyocr-3+svn135/FuzzyOcr.scansets =================================================================== --- fuzzyocr-3+svn135.orig/FuzzyOcr.scansets 2008-09-28 11:16:06.000000000 +0200 +++ fuzzyocr-3+svn135/FuzzyOcr.scansets 2008-09-28 11:16:13.000000000 +0200 @@ -44,13 +44,13 @@ args = -l 180 -d 2 -i $input } -# An example Scanset how to use tesseract (disabled by default) -#scanset tesseract { -# preprocessors = maketiff -# command = $tesseract -# args = $input $output -# force_output_in = $output.txt -#} +# An example Scanset how to use tesseract +scanset tesseract { + preprocessors = maketiff + command = $tesseract + args = $input $output + force_output_in = $output.txt +} # Another example, this basically does the same as the inverted Ocrad Scanset # Only listed here to serve as example, ocrad-invert does this already debian/patches/skippdf_missingdelete.patch0000644000000000000000000000110712146266716016224 0ustar Description: fix warnings while scanning PDFs Forwarded: Christian Holler Author: Gerald Turner Bug-Debian: http://bugs.debian.org/634009 Last-Update: 2011-07-15 --- fuzzyocr-3.6.0.orig/FuzzyOcr.pm 2011-07-15 11:34:42.000000000 -0700 +++ fuzzyocr-3.6.0/FuzzyOcr.pm 2011-07-15 11:33:12.000000000 -0700 @@ -261,6 +261,7 @@ if ($imgfiles{$filename}{ftype} == 6) { unless ($conf->{focr_scan_pdfs}) { infolog("Skipping PDF file: PDF Scanning was disabled in config"); + delete $imgfiles{$filename}; next; } } else { debian/patches/general0000644000000000000000000000623512146266716012176 0ustar --- fuzzyocr-svn-135.orig/FuzzyOcr.cf +++ fuzzyocr-svn-135/FuzzyOcr.cf @@ -1,7 +1,10 @@ # Syntax: # loadplugin # path where Plugin resides. -loadplugin FuzzyOcr FuzzyOcr.pm + +loadplugin FuzzyOcr + +ifplugin FuzzyOcr body FUZZY_OCR eval:fuzzyocr_check() body FUZZY_OCR_WRONG_CTYPE eval:dummy_check() @@ -50,8 +53,8 @@ priority FUZZY_OCR 900 ### # Here we defined the words to scan for -# Default value: /etc/mail/spamassassin/FuzzyOcr.words -#focr_global_wordlist /etc/mail/spamassassin/FuzzyOcr.words +# Default value: /etc/spamassassin/FuzzyOcr.words +#focr_global_wordlist /etc/spamassassin/FuzzyOcr.words # # This is the path RELATIVE to the respective home directory # for the personalized list. This list is merged with the global @@ -143,8 +146,8 @@ focr_bin_helper tesseract # Paths to the files containing Scansets and Preprocessors definitions # -#focr_preprocessor_file /etc/mail/spamassassin/FuzzyOcr.preps -#focr_scanset_file /etc/mail/spamassassin/FuzzyOcr.scansets +#focr_preprocessor_file /etc/spamassassin/FuzzyOcr.preps +#focr_scanset_file /etc/spamassassin/FuzzyOcr.scansets # Setting this to 1 will cause FuzzyOcr to skip all other scansets, # if a scanset has reached the amount of hits specified in @@ -313,18 +316,18 @@ focr_bin_helper tesseract # If the image hash database feature is enabled (Type 1 Hashing), # specify the file to use as database -# Default value: /etc/mail/spamassassin/FuzzyOcr.hashdb -#focr_digest_db /etc/mail/spamassassin/FuzzyOcr.hashdb +# Default value: /etc/spamassassin/FuzzyOcr.hashdb +#focr_digest_db /etc/spamassassin/FuzzyOcr.hashdb # If the image hash db feature is enabled (Type 2 Hashing), # specify the file to use as the SPAM database -# Default value: /etc/mail/spamassassin/FuzzyOcr.db -#focr_db_hash /etc/mail/spamassassin/FuzzyOcr.db +# Default value: /etc/spamassassin/FuzzyOcr.db +#focr_db_hash /etc/spamassassin/FuzzyOcr.db # If the image hash db feature is enabled (Type 2 Hashing), # specify the file to use as the HAM database -# Default value: /etc/mail/spamassassin/FuzzyOcr.safe.db -#focr_db_safe /etc/mail/spamassassin/FuzzyOcr.safe.db +# Default value: /etc/spamassassin/FuzzyOcr.safe.db +#focr_db_safe /etc/spamassassin/FuzzyOcr.safe.db # Auto-prune: Expire records from hasing databases after these many days # Default value: 35 @@ -374,3 +377,5 @@ focr_bin_helper tesseract ################################################################# # DO NOT REMOVE THIS LINE, IT IS REQUIRED UNDER ALL CIRCUMSTANCES focr_end_config + +endif --- fuzzyocr-svn-135.orig/FuzzyOcr.pm +++ fuzzyocr-svn-135/FuzzyOcr.pm @@ -36,7 +36,7 @@ use Time::HiRes qw( gettimeofday tv_inte use String::Approx 'adistr'; use FileHandle; -use lib qw(/etc/mail/spamassassin); # Allow placing of FuzzyOcr in siteconfigdir +use lib qw(/etc/spamassassin); # Allow placing of FuzzyOcr in siteconfigdir use FuzzyOcr::Logging qw(debuglog errorlog warnlog infolog); use FuzzyOcr::Config qw(kill_pid --- fuzzyocr-svn-135.orig/FuzzyOcr.words +++ fuzzyocr-svn-135/FuzzyOcr.words @@ -14,6 +14,7 @@ company money::0.01 million thousand +portfolio buy price::0.2 trade debian/patches/silence_log0000644000000000000000000000062312146266716013037 0ustar --- fuzzyocr-3.5.1+svn135.orig/FuzzyOcr/Config.pm +++ fuzzyocr-3.5.1+svn135/FuzzyOcr/Config.pm @@ -629,7 +629,8 @@ if (defined $conf->{$b}) { infolog("Using $a => $conf->{$b}"); } else { - warnlog("Cannot find executable for $a"); + #do not fill logs + debuglog("Cannot find executable for $a"); } } } debian/patches/untaint_ocr_helper.patch0000644000000000000000000000335312146266716015541 0ustar Description: untaint config entries Explicitly untainting the data from focr_bin_helper and focr_bin_ config entries to make sure Perl can execute the programs in taint mode. Forwarded: Christian Holler Author: Arjan Opmeer Bug-Debian: http://bugs.debian.org/568560 Bug-Debian: http://bugs.debian.org/568233 Last-Update: 2010-05-18 --- a/FuzzyOcr/Config.pm +++ b/FuzzyOcr/Config.pm @@ -577,7 +577,7 @@ sub parse_config { return 1; } elsif ($opts->{key} eq 'focr_bin_helper') { my @cmd; $conf = $opts->{conf}; - my $val = $opts->{value}; $val =~ s/[\s]*//g; + my $val = Mail::SpamAssassin::Util::untaint_var($opts->{value}); $val =~ s/[\s]*//g; debuglog("focr_bin_helper: '$val'"); foreach my $bin (split(',',$val)) { unless (grep {m/$bin/} @bin_utils) { @@ -618,6 +618,7 @@ sub finish_parsing_end { delete $conf->{$b}; } if (defined $conf->{$b}) { + $conf->{$b} = Mail::SpamAssassin::Util::untaint_var($conf->{$b}); debuglog("Using $a => $conf->{$b}"); } else { foreach my $p (@paths) { diff --git a/FuzzyOcr/Logging.pm b/FuzzyOcr/Logging.pm index bed9ff5..ef02b32 100644 --- a/FuzzyOcr/Logging.pm +++ b/FuzzyOcr/Logging.pm @@ -31,7 +31,8 @@ sub logfile { my $time = strftime("%Y-%m-%d %H:%M:%S",localtime(time)); $logtext =~ s/\n/\n /g; - unless ( open LOGFILE, ">>", $conf->{focr_logfile} ) { + my $fname = Mail::SpamAssassin::Util::untaint_file_path($conf->{focr_logfile}); + unless ( open LOGFILE, ">>", $fname ) { warn "Can't open $conf->{focr_logfile} for writing, check permissions"; return; } debian/patches/netpbm-DFSG0000644000000000000000000000271712146266716012570 0ustar --- fuzzyocr-svn-135.orig/FuzzyOcr.cf +++ fuzzyocr-svn-135/FuzzyOcr.cf @@ -99,7 +99,8 @@ priority FUZZY_OCR 900 # Include additional scanner/preprocessor commands here: # -focr_bin_helper pnmnorm, pnminvert, pamthreshold, ppmtopgm, pamtopnm +focr_bin_helper pnmnorm, pnminvert, ppmtopgm +#not available in Debian: pamthreshold,pamtopnm focr_bin_helper tesseract # These helpers must be defined before enabling PDF scanning --- fuzzyocr-svn-135.orig/FuzzyOcr.preps +++ fuzzyocr-svn-135/FuzzyOcr.preps @@ -16,17 +16,6 @@ preprocessor ppmtopgm { command = ppmtopgm } -# Converts PAM to PNM -preprocessor pamtopnm { - command = pamtopnm -} - -# Uses thresholding on the PAM file -preprocessor pamthreshold { - command = pamthreshold - args = -simple -threshold 0.5 -} - # converts PNM to TIFF (this is used for tesseract) preprocessor maketiff { command = pnmtotiff --- fuzzyocr-svn-135.orig/FuzzyOcr.scansets 2008-09-26 17:08:02.000000000 +0200 +++ fuzzyocr-svn-135/FuzzyOcr.scansets 2008-09-26 17:13:31.000000000 +0200 @@ -20,14 +20,14 @@ # Inverted Ocrad scanset with decolorization scanset ocrad-decolorize-invert { - preprocessors = ppmtopgm, pamthreshold, pamtopnm + preprocessors = ppmtopgm command = $ocrad args = -s5 -i $input } # Ocrad scanset with decolorization scanset ocrad-decolorize { - preprocessors = ppmtopgm, pamthreshold, pamtopnm + preprocessors = ppmtopgm command = $ocrad args = -s5 $input } debian/compat0000644000000000000000000000000212146266716010377 0ustar 9