Mail test -- Cannot assign requested address - connect(2)

Hi Folks,

discourse-doctor tells me to post this error:

DISCOURSE DOCTOR Sun Mar 8 20:18:13 CET 2020
OS: Linux discourse-mksp 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=REDACTED
SMTP_ADDRESS=REDACTED
DEVELOPER_EMAILS=REDACTED
SMTP_PASSWORD=REDACTED
SMTP_PORT=587
SMTP_USER_NAME=REDACTED
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 18.09.7, build 2d0083d

DOCKER PROCESSES (docker ps -a)

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d82aefafb601 local_discourse/app “/sbin/boot” 24 minutes ago Up 21 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app

Discourse container app is running

==================== PLUGINS ====================
- git clone discourse/docker_manager.git
- git clone discourse/discourse-checklist.git
- git clone paviliondev/discourse-events.git

WARNING:
You have what appear to be non-official plugins.
If you are having trouble, you should disable them and try rebuilding again.

See discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at localhost: Discourse 2.5.0.beta2

==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 2040

          total        used        free      shared  buff/cache   available

Mem: 1992 1276 132 36 584 498
Swap: 3069 19 3050

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 29G 18G 10G 64% /

---------- Container Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
overlay 29G 18G 10G 64% /
/dev/vda1 29G 18G 10G 64% /shared
/dev/vda1 29G 18G 10G 64% /var/log

==================== DISK INFORMATION ====================
Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x69116d01

Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 60819071 60817024 29G 83 Linux
/dev/vda2 60819072 62912129 2093058 1022M 5 Extended
/dev/vda5 60819074 62912129 2093056 1022M 82 Linux swap / Solaris

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from mail-tester
Sending mail to REDACTED . .
Testing sending to <recipient> using <user>:<password>@mail.4830.org:587.
======================================== ERROR ========================================
UNEXPECTED ERROR

Cannot assign requested address - connect(2) for “mail.4830.org” port 587

====================================== SOLUTION =======================================
This is not a common error. No recommended solution exists!

Please report the exact error message above to meta discourse
(And a solution, if you find one!)

==================== DONE! ====================

1 Like

So your site works, it just can’t send email?

1 Like

Correct.
I’ve tested a different mail server this morning with the same error.

It’s possible to connect via telnet from inside the docker container.
telnet mail.4830.org 587
Trying 193.26.120.251...
Connected to mail.4830.org.

1 Like

A bit of an old post but I never found the solution for this message on this website. For me it was a problem of the user account on the mail server (which is the same host). The Maildir for the local user was missing, so the mail server (postfix) threw an error when the pop3 connection was established. I guess there is some bad try/catch in the logs that shows this as a “connect” error but it is simply a mail server error.

1 Like