Knowledge base

Engine version rollback and configuration via the API

Configuration API on downgrade
Invisible, but not deleted

What happens to configuration created through the API if PowerMTA itself is rolled back to an earlier version.

To a version without the API (before 5.5) the configuration is ignored. For rollbacks between versions with the API the manual gives a table: from 6.0r1 and earlier to 5.5 — everything works; from 6.0r2 and later to 6.0r1 or 5.5 — the API is turned off, and the configuration is kept on the previously created files; from 6.0r3 and later to 6.0r2 — the API works, but hashed addresses are ignored until upgrading back.

A rollback after a failed API operation can break startup: the created files remain invalid. The manual advises doing a reload before rolling back.

The main trap is rolling back right after an API failure. A failed operation leaves invalid files in /var/lib/pmta/config-api, and the rolled-back engine will not start with them; a reload before rolling back rewrites them with the current configuration.
What the Hub does. Not used: the Hub does not enable the configuration API and does not roll back engine versions.
Recommended values

What survives a rollback:

From To What happens
6.0r1 and earlier 5.5 everything works
6.0r2 and later 6.0r1, 5.5 the API is off, configuration from the created files
6.0r3 and later 6.0r2 the API works, hashed addresses are ignored
The rollback table and the startup warning come from the manual (§ 8.3.1). The trap analysis is ours.
Example configuration
# before rolling back the engine, rewrite the API files with the current configuration
pmta reload
The manual calls the reload a precaution; files that are already broken are fixed manually.
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
Before rolling back, find out the version and the state of the API files:
pmta show version
ls -l /var/lib/pmta/config-api/
The version determines the table row, and the file modification time shows whether there was a reload after the last operation.
In the Hub
Cost of a mistake
dangerous: effects outlast a rollback
Scenarios
Prepare a node for sending