Skip directly to page content
b13 GmbH

Hauptstätter Str. 59
70178 Stuttgart
Germany
+49 (0) 711 460 589 70 [email protected]
Envelope icon with a circular arrow, indicating the action of replying to an email, set against a gradient background.

Documentation

TYPO3 Extension “Mail Queue”
Version 1.9.0 (23 Nov 2026)

Chapters of this Documentation
Command When Purpose
mailqueue:flush Every minute Deliver due queued entries, up to 50 per run; evaluate webhook health
mailqueue:cleanup Daily Drop aged sent and failed rows—and optionally queued—plus payload files and orphan files
mailqueue:purge Ad hoc Wipe one status (queued, failed, or sent) with --dry-run and --force
mailqueue:send-test Smoke test Send a test mail through the same spool path; --simulate-failure verifies the file-backed path

mailqueue:flush

* * * * *  cd /path/to/project && vendor/bin/typo3 mailqueue:flush

This is the job that makes the queue a queue. Without it, failed mails stay queued forever.

Each run delivers at most 50 due entries, so a large backlog drains at roughly 50 mails per minute. Before delivering, the run recovers entries stuck in sending from a crashed previous run—anything claimed for more than 15 minutes goes back to queued.

The run also evaluates queue health and fires the alert webhook on a state change. Under a hold it delivers nothing but still evaluates health, so the widget reflects the growing queue.

A run that finds nothing due prints nothing, so a cron job does not send a system mail every minute. Add -v to see "Queue is empty — nothing due."; a run that delivers, retries or fails a mail always prints its summary.

TYPO3's own mailer:spool:send also flushes this queue.

mailqueue:cleanup

15 3 * * *  cd /path/to/project && vendor/bin/typo3 mailqueue:cleanup

Removes, after the configured retentions:

  • sent entries older than sentRetentionDays (30 days by default)
  • failed entries without a payload file, older than failedRetentionDays (90 days by default)
  • failed entries with a payload file, after the shorter attachmentRetentionDays (14 days by default). The two failed retentions are mutually exclusive—each entry falls under exactly one of them, depending on whether its payload lives in a file
  • queued entries older than queuedRetentionDays—only when that is set to a positive value; the default 0 disables it so production retries are never dropped early
  • The payload files belonging to those rows, plus a date-based sweep for orphaned files

mailqueue:purge

vendor/bin/typo3 mailqueue:purge --status=queued --dry-run   # preview the count
vendor/bin/typo3 mailqueue:purge --status=queued --force     # delete rows and payload files

Wipes one status in one go, rows and payload files together. --status defaults to queued; failed and sent are allowed the same way. --force (short: -f) is required for the destructive run; without it, nothing is deleted.

The typical use is clearing a staging queue that accumulated under force hold, or cleaning up after a load test.

mailqueue:send-test

vendor/bin/typo3 mailqueue:send-test [email protected]                     # plain mail
vendor/bin/typo3 mailqueue:send-test [email protected] --attachment        # with a ~200 KB attachment
vendor/bin/typo3 mailqueue:send-test [email protected] --simulate-failure  # file-backed queue path

Sends a test mail through the exact same path as any application mail, including the spool. That is what makes it a real smoke test rather than a transport check.

--attachment (short: -a) attaches a generated file. On a healthy SMTP server that mail just goes out; the payload only reaches var/mailqueue/ when delivery fails, or with archive mode on.

--simulate-failure (short: -s) makes the delivery fail on purpose, without touching the mail server. It implies --attachment, so the mail takes the file-backed path:

  1. The payload is written to var/mailqueue/, and the entry is queued like any mail after a transient failure.
  2. The command reads the file back and restores the mail the same way mailqueue:flush does, and reports the file’s path, permissions, and owner.
  3. The first mailqueue:flush run after the reported due time (about a minute) delivers the mail for real.

The command fails with a clear message if the spool is not active, if the entry was not queued, or if the file cannot be read back. See Smoke Test for how to use it across users.