How To Use Pre-Processing Tasks

Tasks available vary by JEMH version

Scenario

Pre-processing tasks allow email message headers to be manipulated in specific ways in order to change the outcome of email processing.

Pre-processing tasks are designed to help overcome specific problems that emails can have.  It is strongly recommended that a task is not enabled unless you are certain of the cause of a processing problem.

Setting up a Pre-Processing Task

Enabling the use of tasks

First, JEMH's Auditing feature must be enabled.  To do this, go to JEMH>Auditing>Settings>Inbound auditing and click the Toggle Switch.  This is required as the Auditing function handles the storage of incoming emails.

In this example we will be enabling the Groupwise Addressee Pre-processing task, but the process is the same for all other Tasks.  Edit the Email section of the Profile:

Scroll down to the Pre-processing section, and check the Use Reprocessed Message check-box.

Selecting Pre-Processing Tasks

Under Use Reprocessed Message, you will see a list of available pre-processing tasks.  Select tasks with a click, de-select tasks with CTRL + click.

In this example, the Groupwise task will be selected:

Once selected, scroll to the bottom of the page and save the changes to the JEMH profile by using the Submit button.

Once the form is saved the selected task will be shown on the main configuration view.  Some tasks can be configured further.  Clicking the edit icon  next to a task opens a task-specific configuration pop-up.  Where no configuration exists, some helpful text will be presented.

Pre-Processing Task details

Script Pre Processing Task

See subpage : https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/2272919579

Missing To: Address

Since 1.7.x

Function

If the To: header is missing (perhaps because the message was BCC delivered and the final leg mail host didn't include a courteous Delivered-To: header, then JEMH can inject a configurable value. By missing, it could also be the case that the To: header is present without a value.

Scenario

In this case, clicking the edit icon brings up the editable address entry form. A single valid SMTP address should be supplied, that can include personal part if needed, eg:

Here is what it looks like after selecting during editing the Email section:

Clicking the pen icon above allows entry of the address:

Groupwise Addressee

Content Type Mapper

Problem Type

Description

Configuration

Problem Type

Description

Configuration

GB2312

GB2312 charset is not valid for Java Mail to process. Mapping to the similar GBK charset makes it work.

GB2312=GBK

CP932

CP932 is Microsoft's extension of the Shift_JIS character encoding. Java Mail does not recognise this as an alias. MS932 is a supported alias.

CP932=MS932

Mime Multipart

Invalid Content Transfer Encoding Remover

Email header before pre-processing task

Email header after pre-processing task

Email header before pre-processing task

Email header after pre-processing task

Content-Transfer-Encoding: UTF-8

Content-Transfer-Encoding:

MIME Multipart Boundary Updater

Quoted Address Removal

Single Leading Quoted Personal Fixer

Trailing Dot Address Removal

Double Route Address Removal

Content Disposition Filename with unquoted filenames

Missing From Address

Illegal Disposition Attribute Task

Potential Spam Header Locator

Local Address Removal Task

Single Quoted contenttype Removal Task

Semi-colon address separator removal Task

MySQL Subject Cleaner

Single Quote to Double Quote email address personal part converter

Debugging

Auditing allows exporting of both the unprocessed mail and the post-processed mail.  When a change has affected an email, a new export icon is shown that contains the delta email, which is helpful in diagnosing what may have gone wrong with a task:

Related articles