June 2025 · POWERMTA TECHNICAL REFERENCE

PowerMTA Messages Stuck in Queue — Diagnosis, Retry, and Queue Management

June 2025 PowerMTA 6.x PowerMTA Queue Stuck Messages

Messages stuck in the PowerMTA queue are both a symptom and a cause of delivery problems. A large queue of stuck messages indicates an underlying delivery issue — but the accumulation itself adds to the problem by delaying detection of which messages were legitimately rejected versus which might eventually deliver. Managing queue accumulation correctly, including when to force retry and when to delete, is a key operational skill.

Section 1

Identifying Stuck Messages

# Messages in queue for more than 2 hours
pmta show queue --age-min=2h

# Messages in queue for more than 24 hours (critically stuck)
pmta show queue --age-min=24h

# By domain
pmta show queue gmail.com
pmta show queue outlook.com

# Check the last deferral reason for stuck messages
grep "gmail.com" /var/log/pmta/accounting.csv | \
  awk -F, '$1=="t" {print $3, substr($10,1,60)}' | \
  sort -k1 -r | head -20   # Most recent deferrals first

# accounting log format 'f' records = messages that expired (never delivered)
awk -F, 'NR>1 && $1=="f" {print $2, $6, $10}' /var/log/pmta/accounting.csv | \
  head -20
Section 2

Common Causes of Stuck Messages

CauseIndicatorResolution
ISP blocking/throttlingQueue growing for specific ISP; 421 codes in dsnDiagInvestigate reputation; reduce volume
Destination MX unreachableConnection timeout errors; DNS lookup failuresVerify destination domain MX records exist
Domain paused in PowerMTA'pmta show queue domain' shows paused status'pmta resume queue DOMAIN'
IP pool exhaustedAll IPs in pool at max connections; queue growingAdd more IPs or increase max-smtp-out tuning
Pattern-list retry loopMessages being retried indefinitely on permanent errorsFix smtp-pattern-list — bounce 5xx responses
Section 3

Forcing Retry Operations

# Retry all deferred messages immediately
pmta retry queue --all
# WARNING: Only use when underlying issue is confirmed resolved

# Retry specific domain
pmta retry queue gmail.com

# Retry by job ID
pmta retry queue --job-id=campaign-2026-01-15

# Retry messages deferred more than 6 hours
pmta retry queue --age-min=6h

# Resume a paused domain
pmta resume queue gmail.com

# After retry, monitor accounting log:
tail -f /var/log/pmta/accounting.csv | awk -F, '{print $1, $6, substr($10,1,40)}'
# Should see 'd' (delivered) records appearing for previously stuck messages
Section 4

Deleting Stuck Messages

# Delete all messages queued for a specific domain
pmta delete queue --match=rcpt-domain:gmail.com

# Delete by job/campaign ID
pmta delete queue --job-id=campaign-2026-01-15

# Delete messages older than 3 days (cleanup)
pmta delete queue --age-min=3d

# Delete messages matching specific recipient pattern
pmta delete queue --match=rcpt:user@example.com

# Before deleting: consider whether to bounce or silently delete
# Silent delete: sender receives no notification
# Bounce: sends DSN to your bounce-address (informs sending application)
# For campaign messages: silent delete + log is acceptable
# For transactional messages: bounce is preferred so application can retry
Section 5

Expired Messages and expire-after Configuration

# Messages that exceed expire-after become 'f' (failed) records
# Default expire-after: 5 days (too long for most use cases)

# Recommended expire-after values by message type:
# Transactional (2FA, receipts): 6h - 12h
# Marketing campaigns: 1d - 2d
# Newsletter: 2d - 3d
# General default: 2d

# Configure globally and override per domain:

    expire-after 2d    # Global default


# Shorter expiry for transactional traffic

    expire-after 6h   # 2FA codes are useless after 6 hours


# Check your current expire-after setting
grep -E "expire-after" /etc/pmta/config /etc/pmta/*.conf 2>/dev/null
Section 6

Prevention: queue depth monitoring Monitoring

# Alert script: send alert if any ISP queue exceeds threshold
#!/bin/bash
declare -A THRESHOLDS=([gmail.com]=20000 [outlook.com]=15000 [yahoo.com]=10000)

for DOMAIN in "${!THRESHOLDS[@]}"; do
    DEPTH=$(pmta show queue $DOMAIN 2>/dev/null | awk '{sum+=$3} END {print sum+0}')
    THRESHOLD=${THRESHOLDS[$DOMAIN]}
    if [ "$DEPTH" -gt "$THRESHOLD" ]; then
        echo "Queue alert: $DOMAIN has $DEPTH messages queued (threshold: $THRESHOLD)" | \
        mail -s "PowerMTA Queue Alert: $DOMAIN" ops@yourdomain.com
    fi
done
# Cron: */15 * * * * /usr/local/bin/check_queue.sh
FAQ

Frequently Asked Questions

How do I find messages stuck in the PowerMTA queue? +
How do I force an immediate retry for stuck messages? +
Why do messages stay stuck in queue even after the issue is resolved? +
How do I delete stuck messages from the PowerMTA queue? +
What causes messages to be permanently stuck (never delivered and never bounced)? +

Operating PowerMTA at production volume?

We manage PowerMTA environments for high-volume senders — configuration, IP warming schedule, daily reputation monitoring, and operational response. Fully managed. No self-service.

Need a Managed PowerMTA Environment?

Cloud Server for Email operates fully managed PowerMTA infrastructure from EU-based dedicated servers. Daily monitoring, per-ISP domain block optimization, IP warming management, and incident response included.

This PowerMTA reference is part of the Cloud Server for Email technical documentation series covering production configurations and operational procedures from managed infrastructure environments. Configuration values are production-validated starting points; optimal settings depend on your IP reputation tier, ISP distribution, and sending volume. Browse the complete PowerMTA reference series, the MailWizz technical FAQ, and over 130 engineering notes.

For infrastructure-specific guidance — IP reputation analysis, configuration audit, or managed PowerMTA deployment — contact the Cloud Server for Email team at infrastructure@cloudserverforemail.com or +372 602-7190. Technical assessments are conducted at no obligation and produce environment-specific configuration recommendations. The Cloud Server for Email infrastructure team manages PowerMTA environments daily, applying the configuration principles documented in this reference series across clients with varied volume levels, ISP distributions, and reputation histories. Each managed environment receives monthly configuration review, daily monitoring, and incident response as part of the service. Contact us to discuss your specific PowerMTA requirements and receive an assessment of your current configuration against production best practices.

Need PowerMTA support?

Our team works with PowerMTA daily. Contact us for a technical consultation on your specific configuration.