30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

MailerPress Prune Email Logs

mailerpress/prune-email-logs deletes email send-log rows matched by age, status, service, campaign, recipient or subject pattern.

It exists because MailerPress provides no delete route and no retention policy for this table, so rows accumulate indefinitely.

Before you run it

This deletes log rows permanently, and the log is the only record of what was sent to whom and what the provider said about it. Run with dry_run: true first to see exactly what matches, then pass confirm_count equal to that number — the call aborts if the count has changed since, which catches a filter matching more than intended.

At a glance

Abilitymailerpress/prune-email-logs
ToolsetMailerPress — toolset/mailerpress
GroupMailerPress › Campaigns & Sending
RequiresAcrossAI Pro, plus MailerPress active on the site
Capabilitymanage_options
SafetyDestructive — deletes log rows permanently. Requires a dry run first and confirm_count matching it exactly.
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Pro 0.9.16 and later

How it works

On a site sending regularly that table becomes one of the largest in the database, and nothing in MailerPress offers to do anything about it.

The safety design is dry run plus exact count. The dry run reports what matches; the count confirms you looked at it; and the call aborts if the number has changed, which catches both a filter that matched more than expected and rows added since.

That abort is the useful half. A filter written slightly too broadly matches thousands more rows than intended, and the count makes that visible rather than discovered afterwards.

What is lost is real. The log answers “was this email sent, and what did the provider say” and nothing else does — so pruning by age is sensible and pruning by status to remove failures destroys the evidence of a delivery problem.

Prune old successes. Keep the errors.

Not idempotent.

Input

NameTypeRequiredWhat it is
dry_runbooleanNo — run true firstReport what would be deleted without deleting it.
confirm_countintegerFor the real runMust equal the dry run’s count. Aborts if it has changed.
older_than_daysintegerNoMatch rows older than this.
statusstringNoMatch one status.
servicestringNoMatch one SMTP service.
campaign_idintegerNoMatch one campaign.
recipientstringNoMatch one recipient.
subject_likestringNoMatch a subject pattern.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
matchedintegerHow many rows match.
deletedintegerHow many were removed, on a real run.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Clear out email logs older than a year.

It resolves to one call:

{
  "ability": "mailerpress/prune-email-logs",
  "parameters": {
    "older_than_days": 365,
    "dry_run": true
  }
}

Worth knowing

  • MailerPress offers no retention policy, so this table grows forever.
  • The count abort catches a filter that matched more than intended.
  • Prune old successes; keep the errors, which are the evidence.
  • Not idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading