Outgoing email stuck in the queue (port 25 blocked)

For server administrators · Updated 2026-10-29

On this page
  1. Symptoms
  2. Causes
  3. Fix
  4. Good to know
  5. Still not working?

Mail servers deliver to each other on port 25. Many cloud and VPS providers block outgoing port 25 on new servers to fight spam. Then customers can still sign in and send, but nothing leaves the server: every message waits in the queue.

Symptoms

  • Messages to outside addresses stay in Mail Queue & Spam → Mail queue with a reason such as connect to gmail-smtp-in.l.google.com[…]:25: Connection timed out.
  • Delivery reports shows many deferred results for outgoing mail, then expired after a few days.
  • Mail between mailboxes on this server works.

Causes

Most likely first:

  1. The server provider blocks outgoing port 25 (common on new cloud servers and some VPS plans).
  2. The receiving server refuses or delays this server (blocklist, rate limit), with a reason in the queue.
  3. The server cannot resolve names — DNS problems on the server itself.

Fix

See the reason

  1. Open Mail Queue & Spam (section Email) in the admin panel (https://<server>:2087).
  2. On Mail queue, the To / reason column shows why each message waits. The top line shows how many messages were sent, deferred, bounced and rejected in the last 24 hours.

1. Port 25 blocked by the provider

Test from the server (in Terminal, section Server, or SSH):

nc -vz -w 5 gmail-smtp-in.l.google.com 25

A time-out or "Connection refused" for every outside mail server, while websites work, means the provider blocks the port. This server's own Firewall does not filter outgoing connections.

Ask your server provider to open outgoing port 25 for this server. Many providers do it on request, some only after a few weeks of paid use. While you wait, set the reverse DNS (PTR) of the server's IP to the server's hostname in the provider's control panel too: large mail providers expect it.

When the port is open, click Retry all on Mail queue. Waiting messages also go out by themselves at the next retry.

2. The receiving server refuses

Reasons with a 4xx code ("try again later", "rate limited") clear by themselves. Reasons naming a blocklist mean the server's address is listed: find which account sent the spam in Delivery reports, stop it (change passwords, scan with the Malware Scanner), then ask the blocklist to remove the address.

3. Name resolution

If the reason says Host or domain name not found, test DNS on the server:

dig +short gmail.com MX

No answer means the server cannot resolve names: check that the dns service (named) runs in Service Manager.

Good to know

  • Customers send to this server on ports 465 and 587; those are not affected by the provider's port 25 block.
  • Messages that cannot be delivered for several days bounce back to the sender (expired).
  • Delete all deferred removes everything waiting — use it only for spam that is stuck.

Still not working?

If the provider says the port is open and the test still fails, contact the provider with the output of the nc command and the time of the test.

Was this article helpful?

Still stuck?

Ask the AI about your exact situation — it answers from this knowledge base — or contact us.