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.


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".


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.


See Quarantine Email On Another Mail Server for more details.


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


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">

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

X-myheader: myheadervalue

  • 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 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)