Text in Bildern analysieren mit Spamassassin

Mit dem Plugin BayesOCR ist es möglich Spam der nur aus Bildern besteht zu analysieren. Dazu muss einfach Plugin und Konfiguration herunter geladen werden und in /etc/spamassassin abgelegt werden.

https://pralab.diee.unica.it/en/BayesOCR

Als Abhängigkeit wird imagemagick und gocr benötigt.

apt install imagemagick gocr

Nach einem Neustart von spamassassin kann der erfolgreiche Start kontrolliert werden:

service spamassassin restart
spamassassin -D --lint 2>&1 | grep -i BayesOCR
Jan 10 22:54:59.418 [2366946] dbg: config: read file /etc/spamassassin/BayesOCR_PLG.cf
Jan 10 22:54:59.978 [2366946] dbg: config: fixed relative path: /etc/spamassassin/BayesOCR_PLG.pm
Jan 10 22:54:59.978 [2366946] dbg: plugin: loading BayesOCR_PLG from /etc/spamassassin/BayesOCR_PLG.pm
Jan 10 22:54:59.979 [2366946] dbg: PLG-BayesOCR: : new:: register_eval_rule
Jan 10 22:55:02.275 [2366946] dbg: plugin: BayesOCR_PLG=HASH(0x5569b815e478) implements 'check_start', priority 0
Jan 10 22:55:02.276 [2366946] dbg: PLG-BayesOCR: : check_start:: init score
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG30
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.40, 0.30)
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : imageSpam_OCRTextProcessing:: Check for Attached Images
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : imageTextExtractionFromMSG:: Extract & Convert Images
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : imageTextExtractionFromMSG:: 0 images extracted
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check:: Write Mail Header
Jan 10 22:55:02.705 [2366946] dbg: check: tagrun - tag PLGBAYESOCROUT is now ready, value: 0.0 (No images found)
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG70
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.80, 0.70)
Jan 10 22:55:02.705 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG50
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.60, 0.50)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG95
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.99, 0.95)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG80
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.90, 0.80)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG60
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.70, 0.60)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG10
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.20, 0.10)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG20
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.30, 0.20)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG90
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.95, 0.90)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG40
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (0.50, 0.40)
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: Rule: BayesOCR_PLG99
Jan 10 22:55:02.706 [2366946] dbg: PLG-BayesOCR: : BayesOCR_check :: thr: (1.00, 0.99)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert