By default a queue does what is expected of a mail node: it opens an SMTP connection and hands the message to the receiver. But that is only one of five ways, and the other four turn the queue into a processing tool rather than a sending one.
file — each message goes into a file (or is appended to a shared one). pipe — a program is run for each recipient, and the message is fed to its input. http-delivery — the message goes out as a POST request to the given address as a JSON object. discard — the message is thrown away, but an accounting record appears.
The settings of the types do not interfere with each other. The manual says plainly: lines of the discard section are ignored in queues of another type, and the same for the pipe section. A leftover line from a previous type will break nothing — but will do nothing either.
# four types side by side: sending, file, program, webhook <domain gmail.com> type smtp</domain> <domain bounces.example.com> type pipe command "/opt/bounce/parse --envid \"$envid\" \"$user\"" </domain> <domain archive.example.com> type file file-destination /var/spool/archive/ </domain> <domain feedback.example.com> type http-delivery http-delivery-url https://hub.example.com/api/v1/feedback </domain>
what people get wrong and how it ends2 mistakes▶
§ 3.3.10.60
§ 3.3.10.109
2 relations
disable-acct-records<domain>Discarding is the delivery type for which the line is most often added. § 3.3.10.8type<domain>The mechanism as a whole: what each of the five types does and which lines go with it. § 3.3.10.60file-format<domain>The line works only for a queue that writes to a file; in a queue of another type it is ignored. § 3.3.10.110.1file-destination<domain>The line works only for a queue that writes to a file; in a queue of another type it is ignored. § 3.3.10.110.2command<domain>The line is mandatory for a queue that hands messages to a program; in a queue of another type it is ignored. § 3.3.10.111.1macro-variables-preserve-case<domain>A line from the set of the type that hands messages to a program; ignored in a queue of another type. § 3.3.10.111.2
pmta show settings bounces.example.com/vmta1 | head -5 pmta show queues | head -20
3 articles
◇Node metrics in a standard formatThe node exposes counters, gauges and summaries in a widely accepted format: traffic, connections, errors, queue depth and delays.◇How a message gets into the engineSix described submission methods: extended SMTP, four language bindings and a directory the node watches on disk.◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.