Knowledge base

Date header

Date header generator
A helper in the submission APIs

A convenience at the binding level: along with a Base64 encoder, the submission APIs carry a Date: header generator — for those who compose a message from scratch rather than passing a ready one.

The engine has nothing to do with it. Adding a date on the node on behalf of the submitting side is done by a separate line of the submission block — add-date-header.

The main trap is a message without a date. The bindings submit data as is: if the program assembles the message itself and did not add Date:, there will be no header unless the generator is called or add-date-header is enabled on the node — substitution is off by default.
What the Hub does. Not used: the Hub does not use the submission APIs and submits warm-up messages over SMTP.
Recommended values

Who sets the date:

Submission path Who sets Date:
binding the submitting program or addDateHeader
SMTP the submitting program or add-date-header on the node
merge the [*date] variable in the template: add-date-header does not apply to merges
The header generator in the bindings comes from the manual (§ 7, § 7.4.16); substitution on the node, its default and the merge caveat are § 3.3.7.1; the *date variable is § 11.19.4.2. The table is ours.
Example configuration
# add a date header to the message being assembled
msg.addDateHeader();
The method appends a Date: line to the data already added — it is called while the headers are not yet finished.
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 the node sets the date on behalf of the submitting side:
grep -rn 'add-date-header' /etc/pmta/
Without this line the submitting program itself must set the date.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing