Enabling the OCR feature in MailMarshal


This article applies to:

  • Trustwave MailMarshal SEG (8.2.X and above)
  • Optical Character Recognition in image files

Question:

  • How do I enable the OCR feature in MailMarshal?

Background:

As of July 7, 2021, Trustwave provides an OCR feature in MailMarshal 8.2.X and above. This feature attempts to extract text from image files. The extracted text is scanned by MailMarshal layers such as the spam and malware detection and user supplied TextCensor scripts.

Due to performance considerations this feature is not enabled by default.

Prerequisites:

This feature requires a processor with AVX (Advanced Vector Extensions) support. Recommended processors (i3 and above) do support AVX.

Attempting to use this feature on a system without AVX support will result in services failing.

To check your system, you can use the free software HWiNFO (installer or portable version). Check the features panel or report for AVX support.

Procedure: 

To enable the feature:

  1. On the Array Manager server, navigate to the Config subfolder in the SEG installation.
  2. Ensure that the files tensorflow.dll  and tessdata.zip are present. These file are provided through automatic updates from a CDN location.
  3. Make a copy of the file unpacker.config.json
    • Name the copy override.unpacker.config.json 
  4. Edit override.unpacker.config.json and locate the line "MaxImageCount": 0,
    • Change the line to read   "MaxImageCount": 50,
    • Be sure to preserve the comma, quotes, and case of the text. Invalid formatting can cause the SEG services to stop.
  5. Save the file and commit configuration. Restart the Engine service.
  6. Monitor the Content Analysis log or Engine log for text files named ImageExtracted.txt
    • In debug logging additional information is logged, such as:
      • Unpacking image <filename> consumed nnnn milliseconds
      • Image OCR: timeout limit exceeded
  7. If image extraction is often timing out, you can change the "Timeout" setting in override.unpacker.config.json (values in milliseconds). However, you should use caution to avoid excessive delay and resource usage.

Notes:

The json file also contains other advanced settings. Trustwave recommends against making other changes.


Last Modified 10/22/2022.
https://support.trustwave.com/kb/KnowledgebaseArticle21161.aspx