Knowledge base

One question to one receiver

Try a delivery and record the answer

The task. A receiver behaves strangely, and you need to see what it actually replies — without editing the configuration, without logging into the node with a shell and without leaving traces.

What it is made of:

  • rotate log — starts a fresh log file so the attempt does not get lost;
  • trace — one delivery attempt for a queue with the conversation recorded; –to-log writes it to the log file;
  • /getFile — fetches the log file through the monitor.

The parts have different scopes. All three are node commands and an endpoint of the management interface the Hub already works with; the configuration file is not touched, and there is nothing to roll back.

How they interact. The manual calls trace –to-log a shortcut for the procedure “enable recording in the configuration, reload, schedule an attempt and revert everything”. Rotating before the attempt limits the file, and the download brings the attempt rather than a day of log. The order is not arbitrary: rotation, attempt, download. For watching a receiver over time, recording in the <domain> block remains.

The main trap is considering trace a safe check. It is a real delivery attempt: a message from the queue that the receiver accepts goes out, and –retry-recipients additionally releases all deferred recipients of the queue.
What the Hub does. It does not apply it: of the three steps the Hub has one — the “Rotate logs” operation in the “Control” section. The Hub does not run the trace command or download the log through the monitor.
Recommended values

Three steps:

Step Command What it gives
rotation pmta rotate log a fresh log file
attempt pmta trace –to-log gmail.com/vmta1 the SMTP conversation in the log
download GET /getFile?file=… the log file without logging into the node
Log rotation, the trace options and file download come from the manual (§ 6.3.10, § 6.3.23, § 5.11); commands through /command are § 8.4. The scheme itself is our hypothesis.
Example configuration
# rotation, one attempt logged to the log file, download
pmta rotate log
pmta trace --to-log --log-resolution gmail.com/vmta1curl -s 'http://127.0.0.1:8080/getFile?file=log.txt' -o log.txt
The file name is taken from the /logs list; –log-resolution adds name resolution if DNS is suspected.
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 that the attempt was recorded:
grep -n 'starting gmail.com' /var/log/pmta/log | tail -3
A starting line with the command’s time is the attempt in this file; the conversation with the receiver follows.