# Outgoing mail to other servers stays in the queue

UrbeStack sysadmin note about Postfix. Last updated 30 Nov 2026.

Mail to other servers stays in the queue, deferred with `Connection timed out` or `Connection refused` on port 25. When your hosting provider blocks outgoing connections on that port, you can restore Postfix delivery by asking the provider to open it or by using a smarthost.

## Symptoms

Mail between mail accounts on the server arrives. Mail to other servers stays in the queue.

List the queue to see why each message was deferred.

```
urbestack-mail-queue-list
```

The `delay_reason` for an affected message looks like this.

```output
connect to mx.example.net[198.51.100.7]:25: Connection timed out
```

You may also see `Connection refused` in `delay_reason`.

## Cause

Postfix delivers mail to other servers on port 25. Many cloud and VPS providers block outgoing connections to port 25 by default or for new accounts.

## Resolution

Test whether your server can reach port 25 on a receiving server.

```
timeout 10 bash -c 'cat < /dev/null > /dev/tcp/gmail-smtp-in.l.google.com/25' && echo "port 25 open" || echo "port 25 blocked"
```

If the command prints `port 25 blocked`, ask your hosting provider to open outgoing port 25.

You can also send through a smarthost, a relay that accepts your server's mail on port 587. The command defaults to port 587 and requires TLS by default. It reads the relay's password from standard input.

```
urbestack-mail-smarthost-set --host smtp.relay.example --user relay-user --password-stdin
```

Use `--name example.com` to apply the smarthost to one domain only.

Then retry every queued message at once.

```
urbestack-mail-queue-flush
```

Run `urbestack-mail-queue-list` again and check that the queue empties.

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
