Knowledge base

PMTA knowledge base›Block <domain>›Directive§ 3.3.10.99

default-smtp-port

<domain>

Which port to connect to if no explicit server list is set
in the configuration this is a linedefault-smtp-port 25inside the block <domain>
The destination port as a sign of a sending address

The port the node sends mail to over SMTP. The default 25 is the ordinary mail port, and on the open internet there is no reason to change it: the receiver listens exactly there.

The line is overridden by a server list. If the receiver has smtp-hosts with ports after a colon, those apply, not this line.

Why it is touched at all. The manual names one scenario: several PowerMTA nodes talk through an address translation device. Such a device can tell streams apart by destination port — and then each sending address does not need its own local address, its own port is enough. Hence the manual’s example: two streams, 9001 and 9002.

The main trap is editing it in the general block. The port is set per receiver, and the line in the asterisk block sends all mail to a non-standard port, including mail going to the open internet. Nobody listens there: messages get stuck in the queue and bounce on deadline.
What the Hub does. It does not write it — the vendor 25 stays. The Hub’s nodes send to recipients directly or through the proxy gate, and there is no address translation between the nodes: sending addresses differ by the addresses themselves, not by ports.
Recommended values

Keep the default unless you are building address translation. The manual gives no other reason to change the destination port.

Set it inside a stream, not globally. The manual’s example is written exactly this way: the line sits in a receiver block inside <virtual-mta>, and different streams get different ports.

Remember the override. The port from smtp-hosts is stronger; setting both for one receiver is pointless.

The requirement to set it inside a stream comes from the manual’s example. From the same place come the default of 25, the address translation scenario and the rule of override by a server list.
Example configuration
# two streams differ by destination port, not by local address
<virtual-mta vmta1>
    <domain *>
        default-smtp-port 9001    </domain>
</virtual-mta>

<virtual-mta vmta2>
    <domain *>
        default-smtp-port 9002    </domain>
</virtual-mta>
The asterisk is safe here because the block is nested in the stream: the port changes only for this VirtualMTA’s messages, not for all of the node’s mail.
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▶

Setting a non-standard port in the general block

our experience

What it costsAll of the node’s mail goes to a port nobody listens on in the open internet. Connections are not established, messages get stuck and bounce on deadline — and the cause looks like mass unavailability of receivers.
How to spot itConnections fail to all recipients at once.
How to do it rightReturn the default and set the port only inside the needed stream.

Setting a port and next to it a server list with ports

§ 3.3.10.99

What it costsThe ports from the list apply, and this line does nothing. When reading the configuration it is misleading.
How to spot itThe line is set, connections go to a different port.
How to do it rightRemove one of the two: they are about the same thing, and the list is stronger.
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-smtp-port <integer>
Values
a TCP port number; default 25; overridden by ports given in the server list
Default
25 § 3.3.10.99
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
<domain>
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
The value merges across <domain> blocks from general to specific: the best-matching block wins, not the last one in the file. A <domain> block can be nested in <virtual-mta> — that is how different ports are set for different streams. It is overridden by ports from smtp-hosts. It is picked up by pmta reload; it does not affect open connections.
How to check on the node
The effective value is printed by the queue settings command; where the node actually connects is visible from the connections:
pmta show settings example.com/vmta1 | grep -i default-smtp-port
ss -tn state established '( dport = :9001 )' | head
Empty output of the second command with a non-empty queue means the port is not reached: either nobody listens on it or the network is in the way. The Hub does not set the destination port.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Tune the pace for a provider