Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Make PMG monitoring guidance match its collection and access limits

pulse-triage[bot]2c41f68c3312
diff --git a/.github/workflows/public-docs.yml b/.github/workflows/public-docs.yml
index 475d5999b6..c7a38e55fe 100644
--- a/.github/workflows/public-docs.yml
+++ b/.github/workflows/public-docs.yml
@@ -13,6 +13,7 @@ on:
- "scripts/tests/run.sh"
- "scripts/tests/test_public_docs_workflow.py"
- "scripts/tests/test_production_rollout_docs.py"
+ - "scripts/tests/test_pmg_docs.py"
- "scripts/tests/test_pve_backup_troubleshooting_docs.py"
- "scripts/tests/test_vm_disk_diagnostics.py"
- "scripts/tests/test_memory_troubleshooting_docs.py"
@@ -34,6 +35,7 @@ on:
- "scripts/tests/run.sh"
- "scripts/tests/test_public_docs_workflow.py"
- "scripts/tests/test_production_rollout_docs.py"
+ - "scripts/tests/test_pmg_docs.py"
- "scripts/tests/test_pve_backup_troubleshooting_docs.py"
- "scripts/tests/test_vm_disk_diagnostics.py"
- "scripts/tests/test_memory_troubleshooting_docs.py"
@@ -78,6 +80,7 @@ jobs:
run: |
scripts/tests/run.sh \
test_production_rollout_docs.py \
+ test_pmg_docs.py \
test_pve_backup_troubleshooting_docs.py \
test_vm_disk_diagnostics.py \
test_memory_troubleshooting_docs.py \
diff --git a/docs/MAIL_GATEWAY.md b/docs/MAIL_GATEWAY.md
index 9ab2b16888..235d8e21e7 100644
--- a/docs/MAIL_GATEWAY.md
+++ b/docs/MAIL_GATEWAY.md
@@ -1,92 +1,121 @@
-# Proxmox Mail Gateway (PMG) Monitoring
-
-Pulse monitors Proxmox Mail Gateway instances alongside your PVE, PBS, and other infrastructure.
-
-## Features
-
-- **Mail Queue Monitoring**: Track active, deferred, and held messages
-- **Spam Statistics**: View spam detection rates and virus blocks
-- **Cluster Status**: Monitor PMG cluster node health
-- **Quarantine Overview**: See quarantine size and pending reviews
-
-## Adding a PMG Instance
-
-### Via Settings UI
-
-1. Navigate to **Settings → Infrastructure**
-2. Click **Add Node**
-3. Select **Proxmox Mail Gateway** as the type
-4. Enter connection details:
- - Host: Your PMG IP or hostname
- - Port: 8006 (default)
- - Username: e.g., `root@pam` or a dedicated `api@pmg` user
- - Password: the PMG account password
-
-### Via Discovery
-
-Pulse can automatically discover PMG instances on your network:
-
-1. Enable discovery in **Settings → System → Network**
-2. Go to **Settings → Infrastructure**
-3. PMG instances on port 8006 are detected and shown in the Proxmox discovery panels
-4. Click a discovered PMG server to add it
-
-## Service Account Setup on PMG
-
-PMG does not support API tokens. Use a dedicated PMG user with read-only access if possible:
-
-- Create a user in the PMG UI (or CLI) such as `api@pmg`.
-- Assign the minimum permissions needed to read mail statistics and cluster status.
-- Use that username and password when adding the node in Pulse.
-
-## Dashboard
-
-In the v6 unified navigation, PMG data appears on the **Infrastructure** page (filter by **PMG** source):
-
-| Metric | Description |
-|--------|-------------|
-| **Mail Processed** | Total emails processed today |
-| **Spam Rate** | Percentage of spam detected |
-| **Virus Blocked** | Malicious emails caught |
-| **Queue Depth** | Messages pending delivery |
-| **Quarantine Size** | Emails in quarantine |
-
-### Status Indicators
-
-- 🟢 **Healthy**: Normal operation
-- 🟡 **Warning**: Queue building up or high spam rate
-- 🔴 **Critical**: Delivery issues or cluster problems
+# Proxmox Mail Gateway (PMG) monitoring
+
+Pulse reads PMG mail statistics, queues, quarantine totals and cluster information.
+It does not send mail through PMG, release quarantined messages or repair its
+queues. Pulse's own alert email uses a separate SMTP destination in
+**Alerts → Notifications**; see [email troubleshooting](TROUBLESHOOTING.md#emails-not-sending).
+
+## Add a PMG connection
+
+1. Open **Settings → Infrastructure → Add infrastructure**. Search for
+ **Proxmox Mail Gateway**, or use **Show more sources** to reveal its card.
+2. Give the connection a recognisable name and the PMG API address, normally
+ `https://pmg.example.com:8006`. Use the address reachable **from the Pulse
+ server**, not just from your browser. Keep HTTPS and certificate verification
+ enabled; correct the certificate trust or name rather than bypassing them.
+3. Choose **Username & Password**. Use a dedicated PMG service account, such
+ as `pulse-monitor@pmg`, with the minimum read permissions supported by your
+ PMG version for the data you need. Enter its password only in the private
+ settings form; do not put it in a command, URL or issue report.
+4. Review the connection and save it. Check ordinary collection afterwards in
+ **Proxmox → Mail Gateway** (`/proxmox/mail`). A successful connection test
+ does not establish that queues, quarantine and every cluster node were read.
+
+The current PMG credential form uses password authentication, not the PVE/PBS
+API-token setup. Do not follow a PVE/PBS token or privilege-separation recipe
+for PMG, or switch to `root@pam` merely to make a read succeed. An older setup
+hint that refers to PMG API-token fields does not change this form's contract.
+Use the PMG version's own account-management tools for the service account;
+do not grant mail-management or administrator privileges just to fill a panel.
+
+### Discovery is optional
+
+If you already know the endpoint, add it directly; a network scan is not needed.
+Discovery in **Settings → Infrastructure** finds candidate platform APIs on
+configured networks for review. It does not authenticate or add a PMG connection
+by itself, and a missing candidate does not prove the gateway is unavailable.
+Only scan networks you administer and intend to scan. Do not broaden a scan or
+repeat discovery merely to diagnose missing statistics.
+
+### Collection scope is not a no-request guarantee
+
+The connection form offers **Mail statistics & trends**, **Queue health
+insights**, **Quarantine totals** and **Domain-level statistics**. Domain
+statistics are off by default for a new connection. Do not use the individual
+scope switches as a privacy or no-request boundary: mail, queue and quarantine
+requests can still run with their options off. A saved checkbox or an absent
+chart is not evidence that those requests stopped.
+
+If PMG collection must stop, pause the **PMG connection** in
+**Settings → Infrastructure**, rather than deleting it or only disabling
+alerts. Pausing prevents subsequent ordinary polls; it does not cancel a
+request already in flight. PMG readings and alerts are unavailable or stale
+while paused, so use the gateway's own monitoring and arrange independent
+coverage. Restore only the connection you deliberately paused when it is safe
+to resume. Do not restart Pulse or alter PMG queues to verify an opt-out.
+
+## Read the Mail Gateway view
+
+There is no PMG filter on a top-level Infrastructure monitoring page. Use
+**Proxmox → Mail Gateway** and clear its search and status filters before
+treating an absent row as a missing connection. Expand the intended gateway's
+row to inspect its detail; compare connection and node identity, not just a
+similar name in another installation.
+
+| Reading | Meaning and limits |
+| --- | --- |
+| **Mail**, **Spam**, **Virus** | Collected counts, not a mail-delivery receipt or a configurable spam-rate threshold. The drawer labels its mail-statistics timeframe; compare the same window in PMG. |
+| **Queue**, **Deferred** | Reported backlog across collected nodes. The node details separate active, deferred, held and incoming messages, and show the oldest-message age where available. |
+| **Quarantine** | Collected category totals, not a list of messages awaiting your review or permission to release them. |
+| Gateway/node state | Connection and alert context, not proof that all datasets are complete or that intended recipients received mail. Inspect any attention reason and the affected reading separately. |
+| Domain detail | Optional domain statistics; an absent section is not proof of zero traffic. The drawer shows only the top eight reported domains, not the entire domain inventory. |
+
+**Healthy is not complete collection.** The gateway can remain online after a
+mail-statistics, node-queue or quarantine read fails. Some missing fields can
+display as zero or an empty section. A recent overall update time, a green
+badge or one populated panel does not prove that every dataset was read. Compare
+the affected value and observation window with PMG's own existing view before
+acting on an apparent empty queue or quarantine.
## Alerts
-Configure alerts for PMG metrics in **Alerts → Thresholds**:
-
-- Queue depth exceeding threshold
-- Spam rate spike
-- Delivery failures
-- Cluster node offline
-
-## Multi-Instance Support
-
-Monitor multiple PMG instances from a single Pulse dashboard:
-
-- Compare spam rates across gateways
-- Aggregate mail statistics
-- View cluster-wide health
-
-## Troubleshooting
-
-### Connection refused
-1. Verify PMG is accessible on port 8006
-2. Check firewall rules
-3. Ensure the PMG user/password is correct and has read permissions
-
-### No statistics showing
-1. Wait for initial data collection (may take 1-2 polling cycles)
-2. Verify PMG has mail activity
-3. Check Pulse logs for API errors
-
-### Cluster nodes missing
-1. PMG cluster must be properly configured
-2. The PMG user needs cluster-wide permissions
-3. All nodes must be reachable from Pulse
+Open **Alerts → Thresholds → Proxmox** and find **Mail Gateway Thresholds**.
+The configurable PMG thresholds cover total, deferred and held queue counts,
+oldest-message age in **minutes**, spam/virus quarantine counts, and quarantine
+growth **percentage plus minimum message growth**. Check the saved values and
+the intended gateway's overrides; a queue-count threshold is not a percentage.
+
+PMG also has connectivity and mail anomaly checks, but the displayed spam/virus
+counts do not expose a user-configurable spam-rate or delivery-failure
+threshold. An alert in Pulse does not guarantee a notification was routed or
+received. Follow [notification checks](TROUBLESHOOTING.md#test-succeeds-but-real-alerts-are-missing)
+for that separate path. Do not send test mail, fill a queue, release quarantine
+or lower a production threshold merely to generate an alert.
+
+## Troubleshooting without changing the gateway
+
+Use the original error, time and affected dataset before changing credentials
+or permissions:
+
+| Observation | First check |
+| --- | --- |
+| Connection refused or timed out | The saved scheme, host and port, and the network path from the Pulse server. Browser access is a different path; refusal is not a password verdict. |
+| Certificate validation error | The certificate name, expiry and trusted chain for that endpoint. Do not disable verification or change to HTTP. |
+| 401/403 | The configured account and its read permissions for the specific failed request, privately. Do not grant administrator access as a diagnostic shortcut. |
+| Gateway is present but statistics are missing | Clear view filters, check whether the connection is paused, and compare the particular dataset and time window with PMG. A successful test or version read does not establish dataset access. |
+| Cluster nodes or node queues are missing | Compare the gateway's existing cluster inventory and each affected node's native queue view. One reachable node does not prove every node was collected. |
+
+For a new connection, allow its configured polling interval rather than a fixed
+one- or two-cycle promise. If a previously working reading stops advancing,
+retain that observation and the original bounded error; do not repeatedly test,
+scan, restart, re-add the connection or change the mail system to reproduce it.
+Use the [bounded Pulse log readers](TROUBLESHOOTING.md#inspect-notification-logs)
+for your actual deployment if needed. Do not enable Debug to obtain more data.
+
+A useful report names the running Pulse/PMG versions, affected view and dataset,
+original time/sequence, expected versus displayed value and matching native
+time window, plus the relevant redacted error. Use consistent placeholders for
+private gateway/node/domain identities. Keep passwords, tickets, tokens, mail
+addresses, subjects, message contents, full API responses, configuration and
+unredacted screenshots private. Unavailable evidence is unknown, not zero;
+do not recreate mail traffic or repeat a failing action to obtain it.
diff --git a/frontend-modern/public/docs/MAIL_GATEWAY.md b/frontend-modern/public/docs/MAIL_GATEWAY.md
index 9ab2b16888..235d8e21e7 100644
--- a/frontend-modern/public/docs/MAIL_GATEWAY.md
+++ b/frontend-modern/public/docs/MAIL_GATEWAY.md
@@ -1,92 +1,121 @@
-# Proxmox Mail Gateway (PMG) Monitoring
-
-Pulse monitors Proxmox Mail Gateway instances alongside your PVE, PBS, and other infrastructure.
-
-## Features
-
-- **Mail Queue Monitoring**: Track active, deferred, and held messages
-- **Spam Statistics**: View spam detection rates and virus blocks
-- **Cluster Status**: Monitor PMG cluster node health
-- **Quarantine Overview**: See quarantine size and pending reviews
-
-## Adding a PMG Instance
-
-### Via Settings UI
-
-1. Navigate to **Settings → Infrastructure**
-2. Click **Add Node**
-3. Select **Proxmox Mail Gateway** as the type
-4. Enter connection details:
- - Host: Your PMG IP or hostname
- - Port: 8006 (default)
- - Username: e.g., `root@pam` or a dedicated `api@pmg` user
- - Password: the PMG account password
-
-### Via Discovery
-
-Pulse can automatically discover PMG instances on your network:
-
-1. Enable discovery in **Settings → System → Network**
-2. Go to **Settings → Infrastructure**
-3. PMG instances on port 8006 are detected and shown in the Proxmox discovery panels
-4. Click a discovered PMG server to add it
-
-## Service Account Setup on PMG
-
-PMG does not support API tokens. Use a dedicated PMG user with read-only access if possible:
-
-- Create a user in the PMG UI (or CLI) such as `api@pmg`.
-- Assign the minimum permissions needed to read mail statistics and cluster status.
-- Use that username and password when adding the node in Pulse.
-
-## Dashboard
-
-In the v6 unified navigation, PMG data appears on the **Infrastructure** page (filter by **PMG** source):
-
-| Metric | Description |
-|--------|-------------|
-| **Mail Processed** | Total emails processed today |
-| **Spam Rate** | Percentage of spam detected |
-| **Virus Blocked** | Malicious emails caught |
-| **Queue Depth** | Messages pending delivery |
-| **Quarantine Size** | Emails in quarantine |
-
-### Status Indicators
-
-- 🟢 **Healthy**: Normal operation
-- 🟡 **Warning**: Queue building up or high spam rate
-- 🔴 **Critical**: Delivery issues or cluster problems
+# Proxmox Mail Gateway (PMG) monitoring
+
+Pulse reads PMG mail statistics, queues, quarantine totals and cluster information.
+It does not send mail through PMG, release quarantined messages or repair its
+queues. Pulse's own alert email uses a separate SMTP destination in
+**Alerts → Notifications**; see [email troubleshooting](TROUBLESHOOTING.md#emails-not-sending).
+
+## Add a PMG connection
+
+1. Open **Settings → Infrastructure → Add infrastructure**. Search for
+ **Proxmox Mail Gateway**, or use **Show more sources** to reveal its card.
+2. Give the connection a recognisable name and the PMG API address, normally
+ `https://pmg.example.com:8006`. Use the address reachable **from the Pulse
+ server**, not just from your browser. Keep HTTPS and certificate verification
+ enabled; correct the certificate trust or name rather than bypassing them.
+3. Choose **Username & Password**. Use a dedicated PMG service account, such
+ as `pulse-monitor@pmg`, with the minimum read permissions supported by your
+ PMG version for the data you need. Enter its password only in the private
+ settings form; do not put it in a command, URL or issue report.
+4. Review the connection and save it. Check ordinary collection afterwards in
+ **Proxmox → Mail Gateway** (`/proxmox/mail`). A successful connection test
+ does not establish that queues, quarantine and every cluster node were read.
+
+The current PMG credential form uses password authentication, not the PVE/PBS
+API-token setup. Do not follow a PVE/PBS token or privilege-separation recipe
+for PMG, or switch to `root@pam` merely to make a read succeed. An older setup
+hint that refers to PMG API-token fields does not change this form's contract.
+Use the PMG version's own account-management tools for the service account;
+do not grant mail-management or administrator privileges just to fill a panel.
+
+### Discovery is optional
+
+If you already know the endpoint, add it directly; a network scan is not needed.
+Discovery in **Settings → Infrastructure** finds candidate platform APIs on
+configured networks for review. It does not authenticate or add a PMG connection
+by itself, and a missing candidate does not prove the gateway is unavailable.
+Only scan networks you administer and intend to scan. Do not broaden a scan or
+repeat discovery merely to diagnose missing statistics.
+
+### Collection scope is not a no-request guarantee
+
+The connection form offers **Mail statistics & trends**, **Queue health
+insights**, **Quarantine totals** and **Domain-level statistics**. Domain
+statistics are off by default for a new connection. Do not use the individual
+scope switches as a privacy or no-request boundary: mail, queue and quarantine
+requests can still run with their options off. A saved checkbox or an absent
+chart is not evidence that those requests stopped.
+
+If PMG collection must stop, pause the **PMG connection** in
+**Settings → Infrastructure**, rather than deleting it or only disabling
+alerts. Pausing prevents subsequent ordinary polls; it does not cancel a
+request already in flight. PMG readings and alerts are unavailable or stale
+while paused, so use the gateway's own monitoring and arrange independent
+coverage. Restore only the connection you deliberately paused when it is safe
+to resume. Do not restart Pulse or alter PMG queues to verify an opt-out.
+
+## Read the Mail Gateway view
+
+There is no PMG filter on a top-level Infrastructure monitoring page. Use
+**Proxmox → Mail Gateway** and clear its search and status filters before
+treating an absent row as a missing connection. Expand the intended gateway's
+row to inspect its detail; compare connection and node identity, not just a
+similar name in another installation.
+
+| Reading | Meaning and limits |
+| --- | --- |
+| **Mail**, **Spam**, **Virus** | Collected counts, not a mail-delivery receipt or a configurable spam-rate threshold. The drawer labels its mail-statistics timeframe; compare the same window in PMG. |
+| **Queue**, **Deferred** | Reported backlog across collected nodes. The node details separate active, deferred, held and incoming messages, and show the oldest-message age where available. |
+| **Quarantine** | Collected category totals, not a list of messages awaiting your review or permission to release them. |
+| Gateway/node state | Connection and alert context, not proof that all datasets are complete or that intended recipients received mail. Inspect any attention reason and the affected reading separately. |
+| Domain detail | Optional domain statistics; an absent section is not proof of zero traffic. The drawer shows only the top eight reported domains, not the entire domain inventory. |
+
+**Healthy is not complete collection.** The gateway can remain online after a
+mail-statistics, node-queue or quarantine read fails. Some missing fields can
+display as zero or an empty section. A recent overall update time, a green
+badge or one populated panel does not prove that every dataset was read. Compare
+the affected value and observation window with PMG's own existing view before
+acting on an apparent empty queue or quarantine.
## Alerts
-Configure alerts for PMG metrics in **Alerts → Thresholds**:
-
-- Queue depth exceeding threshold
-- Spam rate spike
-- Delivery failures
-- Cluster node offline
-
-## Multi-Instance Support
-
-Monitor multiple PMG instances from a single Pulse dashboard:
-
-- Compare spam rates across gateways
-- Aggregate mail statistics
-- View cluster-wide health
-
-## Troubleshooting
-
-### Connection refused
-1. Verify PMG is accessible on port 8006
-2. Check firewall rules
-3. Ensure the PMG user/password is correct and has read permissions
-
-### No statistics showing
-1. Wait for initial data collection (may take 1-2 polling cycles)
-2. Verify PMG has mail activity
-3. Check Pulse logs for API errors
-
-### Cluster nodes missing
-1. PMG cluster must be properly configured
-2. The PMG user needs cluster-wide permissions
-3. All nodes must be reachable from Pulse
+Open **Alerts → Thresholds → Proxmox** and find **Mail Gateway Thresholds**.
+The configurable PMG thresholds cover total, deferred and held queue counts,
+oldest-message age in **minutes**, spam/virus quarantine counts, and quarantine
+growth **percentage plus minimum message growth**. Check the saved values and
+the intended gateway's overrides; a queue-count threshold is not a percentage.
+
+PMG also has connectivity and mail anomaly checks, but the displayed spam/virus
+counts do not expose a user-configurable spam-rate or delivery-failure
+threshold. An alert in Pulse does not guarantee a notification was routed or
+received. Follow [notification checks](TROUBLESHOOTING.md#test-succeeds-but-real-alerts-are-missing)
+for that separate path. Do not send test mail, fill a queue, release quarantine
+or lower a production threshold merely to generate an alert.
+
+## Troubleshooting without changing the gateway
+
+Use the original error, time and affected dataset before changing credentials
+or permissions:
+
+| Observation | First check |
+| --- | --- |
+| Connection refused or timed out | The saved scheme, host and port, and the network path from the Pulse server. Browser access is a different path; refusal is not a password verdict. |
+| Certificate validation error | The certificate name, expiry and trusted chain for that endpoint. Do not disable verification or change to HTTP. |
+| 401/403 | The configured account and its read permissions for the specific failed request, privately. Do not grant administrator access as a diagnostic shortcut. |
+| Gateway is present but statistics are missing | Clear view filters, check whether the connection is paused, and compare the particular dataset and time window with PMG. A successful test or version read does not establish dataset access. |
+| Cluster nodes or node queues are missing | Compare the gateway's existing cluster inventory and each affected node's native queue view. One reachable node does not prove every node was collected. |
+
+For a new connection, allow its configured polling interval rather than a fixed
+one- or two-cycle promise. If a previously working reading stops advancing,
+retain that observation and the original bounded error; do not repeatedly test,
+scan, restart, re-add the connection or change the mail system to reproduce it.
+Use the [bounded Pulse log readers](TROUBLESHOOTING.md#inspect-notification-logs)
+for your actual deployment if needed. Do not enable Debug to obtain more data.
+
+A useful report names the running Pulse/PMG versions, affected view and dataset,
+original time/sequence, expected versus displayed value and matching native
+time window, plus the relevant redacted error. Use consistent placeholders for
+private gateway/node/domain identities. Keep passwords, tickets, tokens, mail
+addresses, subjects, message contents, full API responses, configuration and
+unredacted screenshots private. Unavailable evidence is unknown, not zero;
+do not recreate mail traffic or repeat a failing action to obtain it.
diff --git a/scripts/tests/test_pmg_docs.py b/scripts/tests/test_pmg_docs.py
new file mode 100644
index 0000000000..4a934f1243
--- /dev/null
+++ b/scripts/tests/test_pmg_docs.py
@@ -0,0 +1,128 @@
+#!/usr/bin/env python3
+"""Keep existing PMG guidance tied to the actual navigation and read limits.
+
+Static source/document checks only: no gateway, mail, credentials, network,
+service, notification or live diagnostic operation is performed.
+"""
+
+from pathlib import Path
+import re
+import unittest
+
+
+ROOT = Path(__file__).resolve().parents[2]
+DOC = ROOT / "docs/MAIL_GATEWAY.md"
+
+
+def frontend(path):
+ return (ROOT / "frontend-modern/src" / path).read_text(encoding="utf-8")
+
+
+def plain(text):
+ return " ".join(text.replace("**", "").split())
+
+
+class PMGDocsTest(unittest.TestCase):
+ def setUp(self):
+ self.text = DOC.read_text(encoding="utf-8")
+ self.guide = plain(self.text)
+
+ def test_shipped_guide_matches(self):
+ self.assertEqual(DOC.read_bytes(),
+ (ROOT / "frontend-modern/public/docs/MAIL_GATEWAY.md").read_bytes())
+
+ def test_connection_instructions_match_existing_picker_and_form(self):
+ picker = frontend("components/Settings/InfrastructureSourcePicker.tsx")
+ authentication = frontend("components/Settings/NodeModalAuthenticationSection.tsx")
+ self.assertIn("Show more sources", picker)
+ self.assertIn("Show more sources", self.guide)
+ self.assertIn("Settings → Infrastructure → Add infrastructure", self.guide)
+ self.assertNotIn("**Add Node**", self.text)
+ self.assertIn("Username & Password", authentication)
+ self.assertIn("Username & Password", self.guide)
+ self.assertIn("modalProps.nodeType !== 'pmg'", authentication)
+ for phrase in ("not the PVE/PBS API-token setup", "minimum read permissions",
+ "password only in the private settings form",
+ "do not put it in a command, URL or issue report",
+ "Keep HTTPS and certificate verification enabled"):
+ self.assertIn(phrase, self.guide)
+
+ def test_navigation_and_dataset_detail_match_the_current_surface(self):
+ model = frontend("features/proxmox/proxmoxPageModel.ts")
+ route = re.search(r"id: 'mail', label: '([^']+)', path: '([^']+)'", model)
+ self.assertIsNotNone(route)
+ self.assertIn(f"**Proxmox → {route[1]}** (`{route[2]}`)", self.text)
+ table = frontend("features/proxmox/ProxmoxMailGatewayTable.tsx")
+ self.assertIn("No instances match current filters", table)
+ self.assertIn("clear its search and status filters", self.guide)
+ self.assertNotIn("on the **Infrastructure** page", self.text)
+ drawer = frontend("features/proxmox/ProxmoxMailGatewayDrawer.tsx")
+ self.assertIn(".slice(0, 8)", drawer)
+ self.assertIn("top eight reported domains, not the entire domain inventory", self.guide)
+ self.assertIn("stats()?.timeframe", drawer)
+ self.assertIn("compare the same window in PMG", self.guide)
+ self.assertIn("Expand the intended gateway's row", self.guide)
+
+ def test_documented_thresholds_exist_and_keep_their_units(self):
+ config = (ROOT / "internal/alerts/config/types.go").read_text()
+ fields = config.split("type PMGThresholdConfig struct {", 1)[1].split("\n}", 1)[0]
+ for key in ("queueTotalWarning", "deferredQueueWarn", "holdQueueWarn",
+ "oldestMessageWarnMins", "quarantineSpamWarn", "quarantineVirusWarn",
+ "quarantineGrowthWarnPct", "quarantineGrowthWarnMin"):
+ self.assertIn(f'json:"{key}"', fields)
+ self.assertNotRegex(fields, r'json:"(?:spamRate|deliveryFailures)')
+ self.assertIn("<ThresholdsTableProxmoxPMGSection", frontend(
+ "components/Alerts/ThresholdsTableProxmoxTab.tsx"))
+ title = re.search(r"ALERT_THRESHOLDS_SECTION_TITLE_PMG = '([^']+)'",
+ frontend("utils/alertThresholdsPresentation.ts"))
+ self.assertIsNotNone(title)
+ self.assertIn(f"**{title[1]}**", self.text)
+ for phrase in ("Alerts → Thresholds → Proxmox", "oldest-message age in minutes",
+ "percentage plus minimum message growth",
+ "do not expose a user-configurable spam-rate or delivery-failure threshold"):
+ self.assertIn(phrase, self.guide)
+ self.assertIn("m.checkPMGAnomalies(pmg, pmgDefaults)",
+ (ROOT / "internal/alerts/pmg.go").read_text())
+ self.assertIn("connectivity and mail anomaly checks", self.guide)
+
+ def test_partial_collection_is_not_a_healthy_zero(self):
+ poll = (ROOT / "internal/monitoring/monitor_pbs_pmg.go").read_text()
+ poll = poll.split("func (m *Monitor) pollPMGInstance(", 1)[1]
+ self.assertLess(poll.index('pmgInst.ConnectionHealth = "healthy"'),
+ poll.index("client.GetMailStatistics"))
+ self.assertIn("Healthy is not complete collection", self.guide)
+ self.assertIn("Some missing fields can display as zero or an empty section", self.guide)
+ self.assertIn("does not prove that every dataset was read", self.guide)
+ self.assertIn("Unavailable evidence is unknown, not zero", self.guide)
+
+ def test_opt_out_guidance_does_not_invent_scope_enforcement(self):
+ poll = (ROOT / "internal/monitoring/monitor_pbs_pmg.go").read_text()
+ poll = poll.split("func (m *Monitor) pollPMGInstance(", 1)[1]
+ # Do not lock in the runtime defect. If the owner adds these gates,
+ # the caveat can be reviewed/removed with that containing correction.
+ if any(f"if instanceCfg.{flag}" not in poll for flag in (
+ "MonitorMailStats", "MonitorQueues", "MonitorQuarantine",
+ )):
+ self.assertIn("requests can still run with their options off", self.guide)
+ self.assertIn("not evidence that those requests stopped", self.guide)
+ self.assertIn("if instanceCfg.Disabled", poll)
+ self.assertLess(poll.index("if instanceCfg.Disabled"), poll.index("client.GetVersion"))
+ for phrase in ("pause the PMG connection", "does not cancel a request already in flight",
+ "arrange independent coverage", "only the connection you deliberately paused"):
+ self.assertIn(phrase, self.guide)
+
+ def test_diagnostics_preserve_mail_privacy_and_separate_failure_classes(self):
+ for phrase in ("refusal is not a password verdict", "Certificate validation error",
+ "401/403", "specific failed request", "configured polling interval",
+ "Do not send test mail", "release quarantine",
+ "Do not enable Debug", "bounded Pulse log readers",
+ "addresses, subjects, message contents, full API responses"):
+ self.assertIn(phrase, self.guide)
+ self.assertNotRegex(self.text, r"```(?:bash|sh|powershell|http)\b")
+ self.assertIn("Pulse's own alert email uses a separate SMTP destination", self.guide)
+ self.assertIn("does not guarantee a notification was routed or received", self.guide)
+ self.assertIn("TROUBLESHOOTING.md#test-succeeds-but-real-alerts-are-missing", self.text)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/tests/test_public_docs_workflow.py b/scripts/tests/test_public_docs_workflow.py
index f879b214a4..ffdc373f2e 100644
--- a/scripts/tests/test_public_docs_workflow.py
+++ b/scripts/tests/test_public_docs_workflow.py
@@ -24,6 +24,7 @@ WORKFLOW = ROOT / ".github/workflows/public-docs.yml"
SAFETY_STEP = "Exercise backup safety and diagnostic recipes"
TESTS = (
"test_production_rollout_docs.py",
+ "test_pmg_docs.py",
"test_pve_backup_troubleshooting_docs.py",
"test_vm_disk_diagnostics.py",
"test_memory_troubleshooting_docs.py",