Knowledge base

Numbered merge parts

merge parts
Pieces of a message assembled by number

A message template is split into numbered parts — headers, a paragraph, a block of paragraphs, a body part — and each recipient gets the ones named in their *parts variable: as a list or a range, for example 1,3 or 1-3.

The list sets the order of parts: *parts=1,3,2 puts the third part before the second.

A variable from an optional part is needed only by the recipients who get that part.

The main trap is a part with a variable the recipient was not given. By default an undefined variable turns into nothing (mailmerge-expands-undefined-variables): the message will have a hole in its place.
What the Hub does. Not used: the Hub submits messages one per recipient and varies the text with spintax inside the message.
Recommended values

How *parts reads:

Value What goes out
1-3 all three parts
1,3 the first and the third
1,3,2 three parts, the third before the second
Parts, the *parts variable, lists, ranges and order come from the manual (§ 11.19.4.2–11.19.4.3); the default for undefined variables is § 3.3.1.39. The table is ours.
Example configuration
# a recipient without the second part
XDFN FName="Bob" *parts=1,3
RCPT TO:<bob@example.com>
A recipient’s variables are set with the XDFN command before their RCPT, and the parts themselves are transferred with XPRT commands.
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
Check whether mail merge is allowed for the source:
grep -rn 'allow-mailmerge' /etc/pmta/
Without allow-mailmerge the source will not accept a merge.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Address warm-up