Knowledge base

default-virtual-mta

<source>criticalset by the Hub

The default stream or pool for messages from this source
in the configuration this is a linedefault-virtual-mtainside the block <source>
Where a message goes if nobody named a stream

The bottom step of stream selection. The directive names the stream or pool that a message from this source will leave through — but only when the choice has not been made higher up: neither by a merge variable, nor by a header, nor by a pattern rule.

Three forms of the value. A stream name is the most predictable. A pool name — the engine will hand out messages to the members in rotation. And the reserved by-smtp-source-ip: the node looks at which of its own addresses the connection came to and takes the stream that has this address declared as its sending address — via smtp-source-host or its proxy form.

The same line takes part in choosing the name for the SMTP greeting. Name resolution starts right from it, and this explains a non-obvious rule: if a pool is set here, the greeting always takes the name of its first member, without rotation.

The main trap is treating the default as an assignment. For a platform that never sets service headers there is no difference. For one that starts setting them, the assignment stops working silently: the configuration has not changed, yet messages leave from a different address. The engine has no diagnostics that would name the cause.
What the Hub does. It writes it itself, in both files of the working configuration and differently. In the main file the general 0/0 source gets by-smtp-source-ip: the stream by the address the connection came to — a rule that does not grow with the number of addresses. In the address file the general login’s submission source gets the pool name: a message chosen by neither a header nor a list leaves from one of the pool’s addresses in rotation; each pair’s login gets its own stream. The “domain + address” pairs that the streams and the pool are assembled from are visible on the node card (“Infrastructure → Nodes”, the “Addresses and domains” block). The base configuration has no such line.
Recommended values

What to set. In essence it is a choice of three, determined by how many addresses the source has and who decides which one to leave from:

Value When What you get
stream name the source has exactly one sending address predictable, the greeting matches
pool name there are several addresses and they are equal rotation by the engine
by-smtp-source-ip each address has its own stream one line for the whole fleet

The pool and the greeting. When you set a pool name, remember: the name in the greeting is taken from the first member and does not change for the rest. If the pool’s addresses have different reverse records, set the name for each stream separately, as the second word of smtp-source-host.

The three forms of the value and the rule about the pool name in the greeting come from the manual. The “when to use what” recommendation is ours, from fleet practice.
Example configuration
# the default by connection address — this is how the Hub writes the working configuration
<source 0/0>
    default-virtual-mta by-smtp-source-ip    process-x-virtual-mta yes
    smtp-service yes
</source>
The order of lines here matters more than it seems. The header is allowed, and it ranks above the default: a message with X-Virtual-MTA leaves through the named stream, and everything else through the stream of the address the connection came to.
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 ends3 mistakes▶

Setting a pool name and getting one name in the greeting for everyone

§ 3.3.1.35

What it costsName resolution starts from this line, and for a pool it takes the name of the first member — without rotation. All the pool’s addresses introduce themselves with one name, and for all but one it disagrees with the reverse record.
How to spot itChecks on the receiver’s side pass worse than they should with a correct zone; reports show a mismatch between HELO and the reverse record.
How to do it rightSet the name for each stream separately — as the second word of smtp-source-host. Then resolution reaches the stream’s name and takes the right one.

Building client separation on a single default

§ 9.4

What it costsThe default is canceled by everything higher up the selection ladder. A client that starts setting the header leaves from any address of the node — including someone else’s address being warmed up.
How to spot itIn accounting the client shows stream names that were never given to it.
How to do it rightIf the separation has to be strict, remove process-x-virtual-mta from this source. A default by itself guarantees nothing.

Setting by-smtp-source-ip without declaring streams on all of the node's addresses

§ 9.4.5

What it costsMatching is done against the addresses declared in the streams’ smtp-source-host. A connection to an address with no stream behind it matches nothing, and the manual does not describe what happens next.
How to spot itSome submissions behave differently from the rest, and the difference correlates with the node’s address rather than with the sender.
How to do it rightKeep the “node address ↔ stream” mapping complete, or leave a regular default with a stream name in a narrow <source> block for the exception addresses.
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
default-virtual-mta <name>
Values
a stream name, a pool name or the reserved by-smtp-source-ip
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 merges by the source rule: a narrower block overrides a wider one, just as with <domain> blocks. The default in <source> 0/0 applies to everyone for whom no narrower block was found. A named source attached to a listener does not take part in this merging — it applies only where it is referenced.
How to check on the node
The node does not show what exactly is assigned to which source. Look at the assembled configuration:
grep -n -B5 default-virtual-mta /etc/pmta/config
You need to make sure of two things: that the block found is really the one the submission address falls under, and that there is no narrower block with a different default. Whether it took effect on a specific message shows only in accounting, in the vmta field.
In the Hub
Managed at
Infrastructure → Sending addresses
Value
The Hub picks it itself — pace, warm-up stage, metrics
Cost of a mistake
reversible: harms only while it is set
Scenarios
Sending address rotation · Connect a sending platform
Priority
critical