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

# QR Code URL Extraction

The QR Code URL Extraction feature is executed on MTAs and it not only scans raster images for QR codes and extracts URLs from them, but also includes the ability to extract QR code URLs from PDF attachments, ensuring a broader and more effective security measure. By default, this feature is enabled and renders a limited number of pages of every PDF attachment. If the default settings meet your needs, no further action is required. However, if you wish to customize these settings, please follow the instructions in the next sections.

As an on-prem user, you can also decide what type of email traffic the rendering process is applied to in order to save some computing power. Since the rendering of mail body preview is quite demanding, it is disabled for most messages with the `EXECUTE_MAIL_RENDER_PREVIEW_INSTRUCTION_*` rule. File preview rendering, controlled by the `EXECUTE_FILE_RENDER_PREVIEW_INSTRUCTION_` rule, is applied more broadly.

> [!NOTE]
>
> Which traffic is rendered by default, and the delivered values of the parameters below, are
> documented in [Detection Defaults → QR code analysis](https://docs.xorlab.com/9.0/detection-defaults.md#qr-code-analysis).
> Password required.

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

> [!WARNING]
>
> Enabling `FILE` or `MAIL` rendering can significantly increase the resource usage on the MTA.

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

> [!TIP]
>
> 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
> ```

## Enabling/disabling QR code URL extraction

1. Open [Expert Editor](https://docs.xorlab.com/9.0/expert-editor.md) 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 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
   ```

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

## 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](https://docs.xorlab.com/9.0/expert-editor.md), 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 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>
   ```

> [!NOTE]
>
> The delivered PDF rendering values are documented in
> [Detection Defaults → QR code analysis](https://docs.xorlab.com/9.0/detection-defaults.md#qr-code-analysis).
> Password required.

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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.