Knowledge base

PMTA knowledge base›Block Global›Directive§ 3.3.1.33

host-id

Globalset by the Hub

A node number that distinguishes its message identifiers from others'
in the configuration this is a linehost-id 0inside the block Global
Zero by default — the same across the whole fleet

The default is 0.

The line is needed by exactly two directives: add-message-id-header and replace-message-id-header. It sets a per-server unique number that keeps two engine installations from producing the same Message-Id.

The problem it solves appears only on several nodes. On one server identifiers do not repeat anyway; on twenty with the shared default of 0, they can.

The main trap is that the default is the same for everyone. Zero is set on every fleet node, and colliding identifiers cause neither an error nor a warning. The collision is discovered when something is searched for by identifier: investigating a complaint, looking for a message in the receiver’s logs, matching a report to a send.

The other half: the line has no effect while adding the identifier is turned off. That is, on a node where Message-Id is always set by the submitting side, the node number does nothing — and that is easy to forget when switching to a different submission scheme.

What the Hub does. It writes it — with the node’s number in the Hub, and that is unique by construction. So two fleet servers will not produce the same identifier.

It is worth checking nodes created before the line appeared in the template: they may have kept the vendor 0.

Recommended values

What to set. There is one requirement — uniqueness within the fleet:

Value When
do not write it there is one node, and no other engine installations are planned
your own number always on a fleet — any unique one will do

The Hub takes the node number from its database: it is unique, does not change and is visible in the cabinet.

The 0 default, the purpose and the link to the two identifier directives come from the manual, § 3.3.1.33. The advice to use the node number is ours.
Example configuration
# the node number plus adding the identifier — they work only together
host-id 7
<source 0/0>
    add-message-id-header true
</source>
Separately, the first line has no visible effect, and the second produces colliding identifiers on a fleet.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends2 mistakes▶

Keeping the default on a fleet

§ 3.3.1.33

What it costsZero is set on every node, and two messages from different servers can get the same identifier. There is no error — things diverge only when searching by identifier.
How to spot ithost-id is missing or equal to zero on several nodes.
How to do it rightGive each node its own number — any unique one will do.

Forgetting the line when changing the submission scheme

our experience

What it costsWhile the submitting side sets the identifier, the node number has no effect. Switching to the engine adding it enables the number silently — along with the risk of collisions.
How to spot itAdding the identifier was enabled, and the node number was not checked.
How to do it rightCheck both lines together with any change to the submission scheme.
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.
Reference data
Syntax
host-id <number>
Values
an integer unique within the fleet
Default
0 § 3.3.1.33
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
Global
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
The directive is written at the root of the configuration file and applies to the whole node: one number per instance. There are no different numbers for different sources or streams — that is the whole point.
How to check on the node
Both halves need to be checked at once:
grep -n '^host-id\|add-message-id-header\|replace-message-id-header' /etc/pmta/config /etc/pmta/virtualhost.txt
A missing line or the value zero means uniqueness across nodes is not ensured. On a fleet this is worth checking on every node, not on one.
In the Hub
Value
The Hub picks it itself — pace, warm-up stage, metrics
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Sender isolation