How do I attach the message header to my email notification?


This article applies to:

  • Trustwave MailMarshal (SEG)
  • Trustwave ECM/MailMarshal Exchange 7.X

Question:

  • How do I attach the message header to my email notification?
  • How do I insert the message header as text into my notification?
  • How do I attach the original MML message file to my notification?
  • Why is the header information lost when message notifications are sent to Exchange?

Causes:

Normally, if you wish to attach the original message in an email notification, then all you need to do is to check the "Message" box in the Edit Message Template window. However, this attaches the original message as a file with a .mml extension. Internal servers like Exchange may convert such attachments to MSG format, in the process removing the header information. If you have encountered this problem, and you need to retain this header information, there are several MailMarshal based workarounds you can use.

To attach the message or header, you can get the files from the location where they are unpacked in MailMarshal processing. Typically messages will be unpacked to:

 

{Install}\Unpacking\Tx\Ux

...where Tx is the Engine thread number
...where Ux is the unpacking depth.

Note the following points also:

  • The variable {Install} covers the install path. As the path may vary, always use this variable.
  • The "Unpacking" folder name is fixed and is explicitly written, as in the examples below.
  • The thread number is provided by the variable {ThreadNo}.
  • The header is always located in the second unpacking depth, therefore U2 is fixed.
  • The header is unpacked as filename MsgHeader.txt

 

Procedure:

Option 1 – Insert Header as text in body

If we wish to insert the text of the header into the body of the notification, use the {file=} construct and point this variable to where the message header is unpacked. It should look like the below example. All you need to do is to copy this variable string directly into the body of the notification.  

{file={Install}\unpacking\t{threadno}\u2\MsgHeader.txt}

Option 2 – Attach message file with envelope

In order to send the message file itself as an attachment in a notification, enable the checkbox under Attachments: | Other. The attached file will have a .mml extension.

The variable {MessageFullName} equates to the actual full file location of the message being worked on by the thread in question. Therefore, to attach the message file we simply enter {MessageFullName} in the "Other" field. However, this method includes the message envelope (server and SMTP handshaking information), which may be confusing to your end users.

Option 3 – Attach message file without envelope

If you wish to attach the message file without the envelope, follow the same logic as for attaching the header above. Here's what you need to consider to make this work:

  • The message file is always unpacked into U1
  • The variable for the message filename is {MessageName}

Thus construct the path of the filename for use in the "Other" field:

{Install}\unpacking\t{threadno}\u1\{MessageName}

Option 4 – Attach Header as text file

Likewise, if you want to attach the header as a text file, provide the path for the file using the string below:

{Install}\unpacking\t{threadno}\u2\MsgHeader.txt

This article was previously published as:
NETIQKB50364

Last Modified 4/1/2020.
https://support.trustwave.com/kb/KnowledgebaseArticle10215.aspx