How can I monitor PowerMTA queue sizes by domain and set up alerts for stuck emails?

Summary

Monitoring PowerMTA queue sizes by domain and setting up alerts for stuck emails involves leveraging PMTA's built-in features and integrating with external tools. Options include utilizing PMTA's web UI for real-time queue statistics, parsing the JSON feed for custom dashboards, analyzing accounting logs, and configuring `notify-of-delay-every` for delay notifications. Rollups can simplify monitoring for multiple domains. External tools like Grafana, rsyslog, and custom scripts can enhance monitoring and alerting capabilities. Defining appropriate thresholds and understanding PMTA's configurations are crucial for effective monitoring.

Key findings

  • JSON Feed and Web UI: PMTA provides a JSON feed with real-time metrics and a web UI for queue statistics.
  • Accounting Logs: PMTA's accounting logs contain detailed information about each message, including queue times.
  • Rollups: `mx-rollup-list` simplifies monitoring for multiple domains by aggregating statistics.
  • Notify Directive: `notify-of-delay-every` configures alerts for delayed messages at the domain level.
  • External Tool Integration: Tools like Grafana, rsyslog, and custom scripts can enhance monitoring and alerting.
  • Threshold Setting: Setting proper thresholds is essential for effective and relevant alerts.

Key considerations

  • Scripting: Parsing JSON feeds or logs and creating custom monitoring tools require scripting skills.
  • Configuration: Proper configuration of rollups, notify directives, and external tools is essential.
  • Resource Usage: Parsing logs or processing large datasets can be resource-intensive.
  • Alert Accuracy: Inaccurate thresholds can lead to false positives or missed alerts.
  • Third-Party Integration: Make sure third party tools are secure and will work with your server setup.

What email marketers say
10Marketer opinions

Monitoring PowerMTA queue sizes by domain and setting up alerts for stuck emails can be achieved through several methods. One approach involves leveraging PowerMTA's web UI to extract queue data in JSON format, which can then be parsed by custom scripts to identify domains exceeding predefined thresholds. Alternatively, PMTA's accounting logs offer detailed message information, including queue times, enabling administrators to detect stalled messages and trigger notifications. External monitoring tools, rsyslog, Grafana, and custom-built solutions can also be integrated to track queue sizes and generate alerts based on specific conditions. Setting up appropriate thresholds for each domain is crucial for effective monitoring and alerting.

Key opinions

  • Web UI Data Extraction: PowerMTA's web UI provides a JSON endpoint ( `/domains?format=json`) that can be used to extract queue sizes programmatically.
  • Accounting Log Analysis: PMTA's accounting logs contain comprehensive message-level data, including queue times, which allows for detecting stuck messages.
  • External Monitoring Integration: External monitoring tools, rsyslog, Grafana, and custom scripts can be integrated with PMTA's logs or JSON feed to provide real-time queue monitoring and alerting capabilities.
  • Threshold Configuration: Configuring appropriate queue size thresholds per domain is essential for effective monitoring and alerting.

Key considerations

  • Scripting Requirements: Extracting and parsing data from the web UI or accounting logs often requires custom scripting skills.
  • Log Volume and Parsing Overhead: Parsing PMTA's accounting logs can be resource-intensive, especially with high email volumes, potentially impacting system performance.
  • External Tool Configuration: Integrating external monitoring tools requires configuring those tools to properly ingest and interpret PMTA's logs or data feeds.
  • Alerting Threshold Accuracy: Inaccurate or poorly configured alerting thresholds can lead to false positives or missed critical events, impacting monitoring effectiveness.
  • Security implications: Ensure proper authorization when pulling data from the PMTA web UI to avoid any security risks.
Marketer view

Email marketer from StackOverflow explains that you can set up alerts by parsing PMTA's accounting logs. The accounting logs contain detailed information about each message, including queue times. Using a log analysis tool or writing a custom script, you can filter the logs to identify messages that have been stuck in the queue for longer than a specified duration and generate alerts accordingly.

December 2024 - StackOverflow
Marketer view

Email marketer from Email Marketing Blog shares that setting up alerts can be achieved using PMTA's accounting logs. These logs provide insights into message status and queue times, enabling you to detect stalled messages and trigger notifications.

October 2021 - Email Marketing Blog
Marketer view

Email marketer from Email Delivery Forums advises developing a custom monitoring tool that integrates with PowerMTA's accounting logs. By parsing these logs, you can track queue sizes per domain and trigger alerts based on specific conditions, such as a certain number of messages stuck in the queue for a prolonged period.

June 2024 - Email Delivery Forums
Marketer view

Email marketer from ReliableEmails shows how you can use tools like Grafana to visualise log data to identify problem domains.

July 2022 - ReliableEmails
Marketer view

Email marketer from Quora explains how to set thresholds and then use a script to pull the numbers. If anything is over that threshold you can then alert your team.

May 2021 - Quora
Marketer view

Marketer from Email Geeks shares a method to get queue sizes in JSON format from the PowerMTA web UI by accessing the '/domains?format=json' endpoint, which can be parsed by an external script.

November 2022 - Email Geeks
Marketer view

Marketer from Email Geeks suggests checking the PMTA documentation for 'notify' directives and contacting Port25 support. Provides an example of the 'notify-of-delay-every' directive.

January 2025 - Email Geeks
Marketer view

Email marketer from Email Delivery Forums notes that you can configure rsyslog to send PMTA logs and configure your system to alert you when the logs match a certain pattern.

April 2022 - Email Delivery Forums
Marketer view

Email marketer from Reddit suggests writing a script to periodically fetch queue statistics from PowerMTA's web UI (using the `/domains?format=json` endpoint) and then parse the JSON output to identify domains with a queue size exceeding a defined threshold. This script can then send an alert via email or other messaging service.

June 2021 - Reddit
Marketer view

Email marketer from Reddit discusses how external monitoring solutions can automatically send alerts for different situations in your PMTA setup.

May 2021 - Reddit

What the experts say
2Expert opinions

Monitoring PowerMTA queue sizes by domain and setting up alerts for stuck emails can be achieved by leveraging PowerMTA's features and integrating with external tools. PowerMTA provides real-time metrics via a JSON feed that can be parsed and monitored. Its comprehensive logging capabilities facilitate integration with external monitoring tools that parse logs, track queue sizes, and trigger alerts based on defined conditions.

Key opinions

  • Real-Time Metrics via JSON Feed: PowerMTA offers a JSON feed that provides real-time metrics, enabling the creation of custom dashboards and alerts.
  • Comprehensive Logging: PowerMTA's logging capabilities allow integration with external tools to parse logs and track queue sizes.
  • External Monitoring Tool Integration: External monitoring tools can be used to parse logs, track queue sizes, and send alerts based on predefined conditions.

Key considerations

  • Scripting for JSON Parsing: Parsing the JSON feed requires scripting to extract and interpret the data.
  • External Tool Configuration Complexity: Integrating external monitoring tools requires configuration to parse logs and set alert thresholds.
  • Resource Intensity of Log Parsing: Parsing logs can be resource-intensive, especially with high email volumes.
  • Defining Accurate Alerting Conditions: Accurate alert conditions (thresholds) need to be defined to prevent false positives or missed critical events.
Expert view

Expert from Spam Resource shares that PowerMTA's comprehensive logging capabilities allow for integrating with external monitoring tools. These tools can then parse the logs, track queue sizes, and send alerts when defined conditions are met, such as exceeding queue size thresholds or identifying stuck messages.

May 2021 - Spam Resource
Expert view

Expert from Spam Resource explains that PowerMTA provides real-time metrics via a JSON feed that can be parsed and monitored. This allows for creating custom dashboards and alerts based on queue sizes per domain, and by using an external script, you can trigger notifications when thresholds are exceeded.

July 2022 - Spam Resource

What the documentation says
4Technical articles

Monitoring PowerMTA queue sizes by domain and setting up alerts for stuck emails can be achieved using several built-in features. Rollups aggregate statistics for multiple domains, simplifying queue size monitoring. PowerMTA's web UI offers real-time queue statistics, enabling identification of domains with high queue volumes. The `notify-of-delay-every` directive allows configuration of delay notification messages. Real-time metrics are accessible via a JSON feed for dashboard integration.

Key findings

  • Rollups for Aggregated Monitoring: The `mx-rollup-list` feature allows aggregating statistics for multiple domains, simplifying monitoring.
  • Web UI for Real-time Statistics: PowerMTA's web-based interface provides real-time insights into queue statistics per domain.
  • Notify Directive for Delay Alerts: The `notify-of-delay-every` directive configures how often PowerMTA checks for delayed messages.
  • JSON Feed for Real-time Metrics: Real-time metrics are accessible via a JSON feed for integration with custom dashboards.

Key considerations

  • Configuration Complexity: Configuring rollups and the `notify-of-delay-every` directive requires understanding of PowerMTA's configuration files.
  • Web UI Limitations: The web UI may not offer advanced alerting capabilities and might require integration with external tools.
  • Scripting for JSON Feed: Using the JSON feed requires scripting to parse and display the data.
  • Alert Configuration: Careful configuration of alerts is necessary to avoid false positives or missed notifications.
Technical article

Documentation from SparkPost Documentation shares that PowerMTA's web-based monitoring interface provides real-time insights into queue statistics. By accessing the web UI, you can view the number of messages queued for each domain, allowing you to identify domains with high queue volumes. Additionally, you can configure alerts based on these statistics using external monitoring tools.

June 2022 - SparkPost Documentation
Technical article

Documentation from SparkPost Documentation details how real-time metrics from PMTA are easily accessible using a JSON feed. These metrics can be displayed in a management dashboard.

February 2024 - SparkPost Documentation
Technical article

Documentation from Port25 Solutions Documentation explains that rollups can aggregate statistics for multiple domains or MX records, allowing for easier monitoring of queue sizes for groups of domains. By using `mx-rollup-list`, you can define rollups based on domain patterns and then monitor the aggregated queue sizes.

December 2021 - Port25 Solutions Documentation
Technical article

Documentation from Port25 Solutions Documentation describes that the `notify-of-delay-every` directive allows you to configure how often PowerMTA checks to see if delay notification messages should be sent. This can be set at the domain level, providing a way to monitor and receive notifications when messages are delayed in the queue for specific domains.

February 2025 - Port25 Solutions Documentation