Knowledge base

delete

critical

Delete messages from the queue
🔴 Irreversible

Deletes recipients from the queue by selection: queue, job, sender, recipient, envelope identifier, age.

Selection is mandatory: although –queue defaults to all queues, the command requires –queue or –jobId explicitly — so that an accidental pmta delete does not empty the queue.

Deletion is recorded in accounting as deleted by the administrator; the –no-accounting option turns that off. With –dsn a non-delivery report goes to the sender, deletion runs slower, and without –accounting there is no accounting entry.

🔴 Irreversible: what is deleted cannot be restored, and we have no spool backups.

The main trap is a selection wider than intended. –queue=*/* or a job shared by several campaigns deletes everything that matches, without asking. Look at the same selection with list first — it has the same options — and only then delete.
What the Hub does. It calls it — the “Clear queue” operation goes through POST /command with the node key as delete –queue=target, only after confirmation in a dialog and with a snapshot of the queue size before and after. The engine does not accept the delete queue target form — this was checked on a node.
Recommended values

Selection options:

Option What it selects
–queue=domain/address queues; stars are allowed
–jobId one job
–orig, –rcpt a sender or recipient
–envId an envelope identifier
–older-than=4d recipients older than the age; the syntax is the same as for bounce-after
The options, the mandatory selection, the accounting entry, –dsn and –no-accounting come from the manual (§ 6.3.24). The “look first” order is ours.
Example configuration
# look at the selection first, then delete
pmta list --queue=yahoo.com/*
pmta delete --queue=yahoo.com/*
The highlighted line is the manual’s example. The one above shows what will be deleted: list takes the same selection options.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Make sure the queue has emptied:
pmta show queues --no-rcpt-events yahoo.com/*
Queues with zero recipients or with no lines in the output mean deletion went through.
In the Hub
Cost of a mistake
dangerous: effects outlast a rollback
Scenarios
Emergency stop · Address suppression
Priority
critical