Knowledge base

log-commands

<source>set by the Hub

Whether to record the whole SMTP conversation
in the configuration this is a linelog-commands falseinside the block <source>
The first thing enabled when investigating connectivity

The line writes the whole protocol exchange to the log — commands one way, responses the other. The default is false.

The vendor calls it the main investigation tool. The manual’s wording is direct: enabling this directive is “usually the first and most useful step” with connectivity problems, because you can see at which step delivery failed.

The second of three levels. log-connections writes the fact of a connection, this one the conversation, log-data every byte. The difference in volume between the first and second is an order of magnitude.

Addresses and receivers’ responses go into the log in full. This is worth remembering next to log-file-world-readable: enabled together, they expose the correspondence to every user on the machine.

The main trap is forgetting to turn it off. The line breaks nothing and therefore outlives the investigation: the log grows, rotation speeds up, and last week’s history disappears before it is needed.
What the Hub does. It writes it — an explicit no, with a “WARNING: verbose!” warning next to it in the template.

This is our position: the line is known, kept off and enabled by hand for the duration of an investigation. It is worth remembering that the Hub rewrites the configuration in full — a line added by hand will disappear on the next apply, and in this case that is how it should be.

Recommended values

Enable it temporarily and in a narrow source:

Value When
no (default) normal operation
yes investigation: submission fails, and you need to see at which step

First it is worth trying the level below — log-connections: it answers the question “does it get through at all” and costs an order of magnitude less.

The false default and the “first and most useful step when investigating connectivity” assessment come from the manual (§ 3.3.7.65). The ladder of levels and the note about an open log are ours.
Example configuration
# investigation: you can see at which step of the conversation it all failed
<source 10.0.0.7>
    log-connections yes
    log-commands true</source>
The two lines together give a full picture of one connection. After the investigation, both are removed.
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▶

Leaving it on after the investigation

our experience

What it costsThe log grows by an order of magnitude, rotation speeds up, and last week’s entries are pushed out ahead of time.
How to spot itThe logs for the needed day have already been deleted by rotation.
How to do it rightRemove the line right away; with edits through the Hub it will disappear on the next configuration apply.

Enabling it together with a world-readable log

our experience

What it costsThe log ends up holding correspondence — addresses, subjects, receivers’ responses — and any user on the machine can read it.
How to spot itlog-file-world-readable true sits alongside.
How to do it rightDo not combine them: either close the log or do not write the conversation to it.
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
log-commands <boolean>
Values
yes | no | true | false
Default
false § 3.3.7.65
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
<source>
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
The directive lives in <source> and goes to whoever’s address matched the block. The conversation with receivers during sending is not recorded from here — there are separate lines in the recipient block for that.
How to check on the node
We look at the log while a message is being submitted:
grep -E "^\S+ \S+ \( *[0-9]+\)(<<<|>>>)" /var/log/pmta/log | tail -30
Lines with >>> are what the peer said, lines with <<< are what the node said. A break is visible from the last pair: that is where the conversation ended.
In the Hub
Managed at
Infrastructure → Node parameters
Value
The Hub picks it itself — pace, warm-up stage, metrics
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Troubleshoot deliverability · Untangle a stuck queue