[ Headers & delivery errors ]

Port 25 filtering and its effect on self-hosted mail

Confirm whether outbound port 25 is restricted before changing DNS, and choose an authorized direct-delivery or relay architecture.

By the EmailAuth research team · 3 min read

[ Key points ]

  • Confirm whether outbound port 25 is restricted before changing DNS, and choose an authorized direct-delivery or relay architecture.
  • Ports 587 and 465 are authorized submission services, not universal replacement ports for direct delivery to recipient MX hosts.
On this page

A self-hosted mail server can have correct domain records and still be unable to connect to recipient mail exchangers. Outbound TCP port 25 is the normal server-to-server SMTP destination, and some networks restrict it. The useful question is whether this particular network path is blocked and what sending architecture the operator is authorized to use.

Separate direct delivery from submission

Direct delivery connects the sending MTA to destination MX hosts. Message submission connects a client to a designated service that accepts responsibility under its own authentication and authorization rules. Changing the destination port in a direct-delivery configuration does not make every recipient MX into an authenticated submission service. RFC 5321 sections 2 and 3.

RFC 6409 distinguishes message submission and reserves port 587 for that service. RFC 8314 describes implicit TLS submission on port 465 and recommends protecting submission with TLS. These are service roles, not universal bypass ports for a blocked connection. Use only a relay or submission endpoint that the operator is entitled to use, following that service's current instructions.

Test the network hypothesis carefully

Start with the sending host's local listener and outbound configuration, routing, firewall policy and logs. Record the actual destination, resolved address, address family, connection timestamp and error. A refusal, timeout and DNS lookup failure are different observations. A port-check website tests its own location and direction unless its documentation establishes otherwise.

Compare a small set of approved destinations and, if available, a second authorized network path. Failure to multiple destinations on one path with success from another supports a path-specific hypothesis, but does not identify the exact device or provider rule. Seek the relevant firewall record or current hosting-provider policy before declaring that the provider blocks port 25. Do not scan arbitrary hosts at scale.

Interpret a hypothetical path comparison

Suppose the same sending host times out to two approved MX destinations, while another authorized network reaches those endpoints. That supports a path-specific investigation but does not identify the responsible device. A local firewall log or current account-specific hosting restriction would provide stronger evidence of the cause.

Now suppose TCP connects but the peer immediately disconnects before 220. That is a different observation: connection establishment succeeded, while SMTP service availability did not. Do not relabel it as a blocked TCP port simply to match the original hypothesis.

These are invented diagnostic cases, not executed scans or measured provider policies. If the network owner confirms intentional egress restrictions, request an approved sending architecture. Do not treat a different port, proxy or route as permission to bypass that restriction.

Choose an authorized repair

If direct delivery is permitted and needed, work with the responsible network owner to correct the documented restriction through its normal process. If the environment intentionally prohibits it, use an approved outbound relay architecture or change the deployment design. Do not disable security controls broadly or route around an organizational restriction without authorization.

A relay migration changes more than connectivity. Inventory the service's envelope sender behavior, DKIM signing, visible From alignment, permitted sender identities and sending limits. Verify these from current service documentation and a controlled message. A relay that accepts a connection may still refuse an unauthorized sender or external recipient.

Verify connectivity and delivery separately

After the approved change, record the successful connection and authenticated or connector-authorized submission where applicable. Then trace an authorized message through the relay to the receiving side. Confirm queue drain and check for duplicates from previous attempts. TCP success does not establish domain authentication, final delivery or inbox placement. Keep each result attached to its actual layer and tested recipient scope.

Choose a permitted sending architecture

  • Direct MX delivery required: confirm the actual network policy with its owner.
  • Direct delivery intentionally restricted: obtain approval for a supported relay design.
  • Relay selected: verify permitted senders, credentials or connector scope, signing and limits.
  • After change: record connection, authorized submission, domain authentication and recipient outcome separately.

[ Takeaway ]

Confirm whether outbound port 25 is restricted before changing DNS, and choose an authorized direct-delivery or relay architecture.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Prove the actual egress condition

DNS and TCP problems need different repairs.

Next steps

  1. Capture destination-specific errors.
  2. Check current provider policy.
  3. Test authorized relay authentication.

CISO / SecOps

Respect network boundaries

A workaround must not defeat an intentional restriction.

Next steps

  1. Approve any egress-policy change.
  2. Limit relay permissions.
  3. Review credential and abuse controls.

Founder / Non-technical

Choose a supportable sending route

Hosting constraints can make direct delivery the wrong operational choice.

Next steps

  1. Confirm the required mail workflow.
  2. Approve the relay or network design.
  3. Track critical backlog recovery.

[ FAQs ]

Frequently asked questions

Does correct SPF open port 25?

No. DNS sender authorization does not change network access.

Can I send directly to every MX on port 587 instead?

No. Port 587 is a submission service, not a universal alternate destination-MX port.

What is port 465 used for here?

Implicit TLS message submission when supported by the chosen service.

Does one timeout prove provider filtering?

No. Confirm the relevant network or provider policy and preserve alternative explanations.

Does a website port test prove my outbound path works?

Only if its documented test actually covers that direction and location; many do not.

Was a hosting provider’s port policy measured in this example?

No. The path comparison and pre-greeting disconnect are hypothetical cases. The actual account policy and network evidence remain necessary.

Can a relay change authentication?

Yes. Verify its envelope, signing and alignment behavior with controlled receiving evidence.

What completes an approved migration?

Working connectivity, authorized relay use, correct authentication and a documented message outcome.

[ Sources ]

Sources

  1. RFC 5321 SMTP

    Sections §3.3 · §4.1.1.1 · §4.2 · §4.5.3.2 · §4.5.4.1 · §5 · §6.1

  2. RFC 6409 Message Submission for Mail

    Sections §3.1

  3. RFC 8314 TLS for Email Submission and Access

    Sections §3.3

  4. RFC 9989: DMARC

    Sections §3.2.10 · §5.3.5

[ Glossary ]

Glossary

Egress policy
Rules governing network traffic leaving an environment.
Submission service
A service accepting messages from authorized clients for further delivery.
Outbound relay
A designated server that forwards authorized outgoing mail.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base