Skip to content
PostCraft
Email campaigns from the MODX manager with a send window, tracking and unsubscribe pages
  • MODX 2
  • MODX 3
  • PHP 7.2
  1. Extras
  2. PostCraft
  3. Settings, cron and bounces

Settings, cron and bounces ​

System settings ​

All settings live in the postcraft namespace.

KeyDefaultPurpose
postcraft_timezoneemptytime zone of the send day and window, for example Europe/Berlin. Empty means the PHP zone
postcraft_sitescreated on installJSON site list, see Several sites
postcraft_unsub_pages{}unsubscribe page texts. Edit them on the Unsubscribe page tab
postcraft_rolehubhub or edge
postcraft_hub_urlemptyfor an edge: the hub URL
postcraft_edge_secretcreated on installshared key of hub and edge
postcraft_bounce_imap_hostemptyIMAP server of the bounce mailbox. Empty turns bounce processing off
postcraft_bounce_imap_port993IMAP port, SSL connection
postcraft_bounce_imap_useremptyIMAP login
postcraft_bounce_imap_passemptyIMAP password
postcraft_bounce_imap_mailboxINBOXfolder

Package upgrades keep the values you have set.

Cron ​

bash
* * * * * php /path/to/site/core/components/postcraft/cron.php

Each run sends the letters that are due, in batches of 100, for up to 40 seconds. With IMAP set up it then processes up to 20 new bounces. A separate bounce task processes up to 50 per run:

bash
*/10 * * * * php /path/to/site/core/components/postcraft/cron.php bounce

The script prints a one-line summary such as queue {"ok":2,"fail":0,"skipped":0,"processed":2}, handy for a log file.

Bounces ​

Mail servers return undelivered letters to the sender. PostCraft reads those letters over IMAP and marks them in the stats:

  • hard bounce (no such address, mailbox deleted): the address goes to the blacklist and the letter gets the Bounce status;
  • soft bounce (mailbox full, temporary error): the event goes to the stats and the address stays in campaigns.

PostCraft links a bounce to its campaign through the bounce+token@domain address or the Final-Recipient field.

Local mailboxes set Return-Path: bounce+token@sender-domain. For bounces to arrive, the domain needs a mailbox or alias that accepts bounce+… addresses. For SMTP mailboxes the SMTP server sets the return address, usually the sender mailbox itself. Point the IMAP settings at it.

The PHP imap extension is required. Processed letters are marked as read.