Large mailbox providers send reports in standard formats, and the engine parses them by itself. Some do not: the message arrives as human text, with the needed information buried in prose.
The mechanism is simple: your own regular expression with named groups. The group name is the accounting field name, and what is extracted goes into the record next to what the engine found itself. The manual’s example is taken from a real complaint service message: from the line Email from 1.2.3.4 the sending address is extracted.
Patterns live in <email-patterns>, nested in the processor. Each processor has its own set, and it can hold several files — one per format.
🔴 Until there is a pattern, the report does not exist for analytics. It gets into neither complaint records nor bounce records — it is just a misunderstood message whose fate is decided by deliver-unmatched-email. That is, the complaint rate for such a receiver will be understated, and there will be nothing to explain it with.
🔎 A sign that it is time: messages to fbl@fbl.<domain> from some receiver are arriving, but there are no complaint records for it in accounting. The panel will then show a zero spam rate for it — that is, the most favorable picture exactly where there is simply no data.
The mechanism has no values of its own — it is enabled by two lines in the patterns block:
| What | Line |
|---|---|
| the pattern itself | body-pattern-file, repeatable |
| which of them matched | log-match-info |
The group names in the expression must match accounting field names — otherwise there is nowhere to put what is extracted.
# the pattern is taken from a real message from the receiver <feedback-loop-processor> <email-patterns> body-pattern-file /etc/pmta/report-pattern.txt log-match-info true </email-patterns> </feedback-loop-processor>
what people get wrong and how it ends1 mistake▶
our experience
1 relation
grep -i "pattern" /var/log/pmta/log | tail -20
3 articles
◇Two inbound report processors and what to do with themBounces by message and complaints are parsed by two identically structured blocks; each has its own address list and its own pair of decisions about the message’s fate.◇A return address with the recipient written into itThe bounce arrives at a unique address, and there is no need to parse its content.◇What to return in a bounce reportWhat to enclose in a bounce report: the whole message or only its headers.