Phase 8: Configure outbound delivery correctly

Navigate to:

Settings
→ MTA
→ Outbound
→ Connection Strategies
→ default

Set:

EHLO hostname:
mail.example.com

Leave Source IP Addresses empty

Do not enter the VPS public IP in Stalwart’s source-IP list when using normal Docker bridge networking.

Incorrect:

Source IP:
203.0.113.10

The public address belongs to the VPS host—not to the Stalwart container.

If Stalwart tries to bind directly to the host IP, outbound delivery fails with:

Cannot assign requested address
os error 99

The correct configuration is:

EHLO hostname:
mail.example.com

Source IP Addresses:
Empty

Docker will automatically translate the container’s internal connection to the VPS public IP using NAT.

Do not enter the temporary Docker 172.x.x.x address either. It can change after redeployment.

Use IPv4-only delivery if Docker IPv6 is unavailable

If the VPS has IPv6 but the Stalwart container does not have working Docker IPv6 routing, Stalwart may produce:

Network is unreachable
os error 101

Navigate to:

Settings
→ MTA
→ Outbound
→ Routes
→ MX route

Set:

IP lookup strategy:
IPv4 only

The internal value may be shown as:

v4Only

The final working configuration is:

EHLO hostname: mail.example.com
Source IPs: empty
MX lookup strategy: v4Only

Verify the SMTP greeting

On the VPS:

printf 'EHLO test.example\r\nQUIT\r\n' |
nc -w 5 127.0.0.1 25

Expected:

220 mail.example.com Stalwart ESMTP at your service
250-mail.example.com ...

Discussions