Validate Email Structure

Background

Emails are required to follow strict formatting according to http://www.w3.org/Protocols/rfc822/ , the Javamail library (API) is shipped with JIRA and reused by JEMH.  Most of the time, email content is valid and there are no problems, however:

There are many many ways an email can be broken (apps and scripts can write really broken emails which makes life interesting!) when JEMH receives such messages they are in an interpreted and unmodifiable Message form.  When an email has been delivered that has structural problems, processing failure is quite likely that usually results in the message being forwarded to the Profile > Notification > Forward User(s).

What follows is a description of the JEMH Features that can be used to minimise the amount of manual triage and increase the compatibility of customer emails with your JIRA.

Using a Re-Processing Message

As part of JEMH Auditing, some common syntax inconsistencies that prevent correct extraction of content can be fixed by using the Pre-Processing feature of JEMH:

  • Email > Pre-processing > Use Reprocessed Message : ON

When to know that you need Re-Processing

When a message fails to be processed (without this enabled), use the JEMH Auditing operation to copy the saved audit item to a JEMH Test Case can allow the message to be re-run against the Profile. IF the Test Case succeeds but the original source repeatedly FAILS this is the scenario that can be fixed by Using ReProcessed Message.

Using Pre-Processing Tasks

When something is wrong with the email structure, its possible that it can be fixed through Pre-Processing Tasks that perform low-level TEXT manipulation of the email content.  In order for these to be used, Pre-Processing needs to be enabled.  For full details of Pre-Processing Tasks, including set-up and example configurations, please see How To Use Pre-Processing Tasks.

Name

Description

Name

Description

Groupwise Addressee

Addresses must be valid SMTP addresses, Groupwise was found to generate massively broken addresses not conformant with: http://docs.oracle.com/javaee/6/api/javax/mail/internet/InternetAddress.html

Content Type Mapper

Content-Type header values are just invalid to Javamail. Sometimes, there are Javamail supported content types that could be used instead. This task allows the mapping of unsupported Content Types to supported ones.

Invalid Content Transfer Encoding remover

Content-Type-Encoding values of mime parts are invalid, e.g. UTF-8 (which is a character set, not an encoding method like quoted-printable). Its possible to remove the header entirely in these cases by specifying the content type in the configuration UTF-8

Quoted Address Removal

Internet Address have to be correct syntax, this task resolves problems where addresses are quoted, eg: 'user@place.com' which is invalid, or <'user@place.com'> which is also invalid

Double Route Address Removal

Internet Address have to be correct syntax, this task resolves problems where addresses are routinely supplied in duplicate, eg: <user@place.com> <user@place.com>, which is invalid

MIME Multipart Boundary Updater

Allows illegal MIME multipart boundaries to be fixed dynamically.

Trailing Dot Address Removal

Filter the "From", "To" and "Cc" addresses for illegal trailing dot.

 

Related articles