Custom Email Headers

The following custom email headers are added once processed by Metadefender Email. These can be used for custom rules on mail servers such as spam rules using X-Metadefender-Core-Result.

X-Metadefender-Core-Urls

The Metadefender Core REST API URL used in scanning operations for this email. If multiple MD Core scanners are configured and have been used for scans (this can happen when an email has multiple attachments) the list is comma separated.

Note: the field is empty if the email doesn't contain attachments.

Note: the URLwill contain the hostname of the machine. If hostname is not available it will contain the machine name. If machine name is not available it will contain "localhost".

X-Metadefender-Core-Result

When workflow is enabled (default), this header value will contain the Metadefender Core process result. For Blocked results, the reason is also displayed (separated by a / character).
Example values:

  • Allowed (or Delivered - if email doesn't contain attachments)

  • Blocked/Dirty

  • Blocked/Filtered

If workflow is disabled this value will be the Metadefender Core scan result for the email. Refer to Description of Scan Results for details.

X-Metadefender-To-Quarantine

See Quarantine Email On Another Mail Server for more details.

X-Metadefender-EmailSecurity-Sanitized

This header is added to all emails that have been sanitized by the Mail Agent (header value 'True')

X-Metadefender-EmailSecurity-OriginalCopy

This header is added to all original copies of sanitized emails (header value 'True')

Your Own Custom X-headers

In addition to the above headers, Mail Agent can also add custom x-headers to every email processed. These X-Headers are configured in Metadefender.Email.Engine.Processor.dll.config as follows:

Custom X-headers
...
<setting name="EmailAddCustomXHeaders" serializeAs="String">
<value>X-MyHeader:MyHeaderValue,X-MyHeaderNoValue:</value>
</setting>
...

The above will add the following 2 X-headers to the email:

X-myheader: myheadervalue
X-myheadernovalue:

  • If header name is not prefixed by X- it will automatically be added to the header name. (myheadername → X-myheadername)

  • Header names should only contain 7-bit characters (ASCII 33-126 included) excluding colon (:) See https://tools.ietf.org/html/rfc2822 for more details. Any header name that does not comply with these restrictions will be ignored (and not added)

  • If no text is added after : the header value will be empty

  • If emails are not processed (Skip Email Analysis), the customers headers will not be appended.

  • X-Headers are only added to emails when direction is configured as Incoming (Web MC > Sources > Metadefender Email > Setup). To force Mail Agent to also add X-Headers to outgoing emails, set AddXHeadersToOutgoingEmail in Metadefender.Email.Engine.Processor.dll.config (See Configuration From Config File)