> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xorlab.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Pages under /latest/ document the current release. Paths that begin with a version number, for example /10.0/, are frozen snapshots of superseded releases kept for reference only — never present their instructions as current. If the reader's version is unknown, answer from /latest/ and say which version the answer describes.
> xorlab is deployed on-premises, hybrid, or as a cloud service, and integrates with either Microsoft 365 or on-premises mail infrastructure. Configuration steps often differ between these. State which deployment and integration mode an instruction applies to instead of presenting one as universal.
> Distinguish inline mode from monitoring mode when describing anything that acts on email. Monitoring mode observes a copy and cannot block or quarantine; inline mode routes mail through xorlab and can.
> Write the product name as lowercase 'xorlab'. Use the documented component names: xorlab Control Center (XCC), xorlab MTA, xorlab Sandbox (DANA), xorlab Natural Language Understanding (NLU). After the first mention, use the short forms XCC, MTA, Sandbox, and NLU. Do not use DANA as a standalone name for the Sandbox, but keep it where it is a literal string in configuration keys, container names, and hostnames.
> Do not invent configuration keys, rule parameters, list names, log properties, or API fields. If a value is not present in this documentation, say that it is not documented rather than guessing.

# Customize QR Code Analysis

> Customize how xorlab extracts and analyzes URLs from QR codes in attachments and rendered previews.

xorlab analyzes QR codes by default and extracts their URLs where available. By default, it applies QR code analysis on:

* Images attached to the email
* Rendered previews of the email body (only done for some emails)
* Rendered previews of attachments (only done for some emails)

## Change rendering policy

xorlab has a separate rendering policy for email body previews as well as for attachment previews.

<Info>
  Which emails and attachments are rendered by default, and the delivered values of the parameters below, are
  documented in [Detection Defaults → QR code analysis](/latest/detection-defaults#qr-code-analysis).
  Access to that page is restricted.
</Info>

You can change this behavior in [Expert Editor](/latest/expert-editor) in the `local.properties` file located at `activeguard/core/rule_sets/90_local/params/` by setting the following parameters to `ACTIVE` or `DISABLED`:

<Warning>
  **Increased resources**

  Enabling `FILE` or `MAIL` rendering can significantly increase the resource usage on the MTA.
</Warning>

```
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_analysis_pipelines_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_qr_code_keywords_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_sender_unknown_never_delivered_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_untrusted_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_external_emails_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_reported_emails_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_internal_emails_state
EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_for_outgoing_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_incoming_emails_untrusted_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_external_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_reported_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_internal_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_outgoing_emails_state
EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_analysis_pipelines_state
```

<Note>
  **QR code analysis for internal/outgoing emails**

  When enabling one of these `FILE_RENDER` rules:

  ```
  EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_internal_emails_state=ACTIVE
  EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_for_outgoing_emails_state=ACTIVE
  ```

  you must also enable the two `FILE_QR_EXTRACTION` rules, otherwise they have no impact:

  ```
  EXECUTE_FILE_QR_EXTRACTION_INSTRUCTION_for_internal_emails_state=ACTIVE
  EXECUTE_FILE_QR_EXTRACTION_INSTRUCTION_for_outgoing_emails_state=ACTIVE
  ```
</Note>

After changing the rule properties, click **Publish**. The rule-set configuration becomes active within about one minute.

## Enabling/disabling QR code URL extraction

1. Open [Expert Editor](/latest/expert-editor) and go to the file located at `activeguard/core/active_guard.yml`.

2. The following configuration represents the default settings, which are automatically applied in the absence of explicit `qrCodeService` configurations in the `active_guard.yml` file.

   ```yaml active_guard.yml theme={null}
   # QR code service: enabled by default. This service is responsible for extracting QR codes from files.
   qrCodeService:
     # Enable or disable service
     enabled: true
   ```

3. To disable the QR Code URL Extraction feature, simply change `enabled: true` to `enabled: false`.

4. Click **Publish**, then restart all MTAs. The `qrCodeService` setting is in `active_guard.yml` and requires an MTA restart; see [How to Activate the Configuration](/latest/activate-configuration).

## Customizing extraction from PDF attachments

For a more tailored approach to handling PDF attachments, you can adjust how the system renders PDF pages for QR code extraction:

1. In [Expert Editor](/latest/expert-editor), open the `activeguard/core/active_guard.yml` file.

2. Locate or add the `pdfFileRenderService` section to adjust the rendering settings for PDF attachments as needed:

   ```yaml active_guard.yml theme={null}
   # PDF File Render Service config
   pdfFileRenderService:
     # Sets how many pages to render, starting with the first page. For example, a value of 1 would render only the first page. A value of 3 would render the
     # first 3 pages. Must be greater than or equal to 1.
     numberOfPages: <pages>
     # Sets the x resolution of the rendered images. Must be greater than or equal to 600 and less than or equal to 3840. Be careful with this setting,
     # as this can significantly increase memory usage during PDF rendering.
     xResolution: <x_resolution>
     # Sets the y resolution of the rendered images. Must be greater than or equal to 600 and less than or equal to 3840. Be careful with this setting,
     # as this can significantly increase memory usage during PDF rendering.
     yResolution: <y_resolution>
   ```

3. Click **Publish**, then restart all MTAs. The `pdfFileRenderService` setting is in `active_guard.yml` and requires an MTA restart; see [How to Activate the Configuration](/latest/activate-configuration).

<Info>
  The delivered PDF rendering values are documented in
  [Detection Defaults → QR code analysis](/latest/detection-defaults#qr-code-analysis).
  Access to that page is restricted.
</Info>

By following these steps, you can activate and configure the QR Code URL Extraction feature according to your organization’s specific needs. Adjusting the PDF rendering settings allows for flexibility in balancing performance with the thoroughness of QR code scanning within your documents.
