Outgoing email stuck in the queue (port 25 blocked)
On this page
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
deferredresults for outgoing mail, thenexpiredafter a few days. - Mail between mailboxes on this server works.
Causes
Most likely first:
- The server provider blocks outgoing port 25 (common on new cloud servers and some VPS plans).
- The receiving server refuses or delays this server (blocklist, rate limit), with a reason in the queue.
- The server cannot resolve names — DNS problems on the server itself.
Fix
See the reason
- Open Mail Queue & Spam (section Email) in the admin panel (
https://<server>:2087). - 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.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- Cannot send email: SMTP authentication failed
Your mail app or website cannot send: "SMTP authentication failed", refused or timed out. Check the username, ports 465/587, bans and the error.
- Email refused: account reached its limit of emails per hour
Mail fails with "451 4.7.1 This account reached its limit of emails per hour". What the hourly sending limit counts, how to see your usage and what to do.
- Emails you send go to spam (Gmail, Outlook)
Your mail lands in spam or is rejected as unauthenticated. Set up SPF, DKIM and DMARC from the Email deliverability table and check the usual causes.