Email sending issues - failed 111 connection refused

Hi folks. I messaged on the forum here a while back and couldn’t get much further in the process of fixing. I’ve been taking a look at the issue of sending email in a docker container I have on a VM hosting Plesk. After trying to send the emails I get timeouts and I was using the invoiceninja log on the app UI. However I’m now looking at the nginx server log in the container and it’s giving me a little more information. It would be great if someone could help me understand where this problem lays, either with IN itself or somewhere else within the Plesk/VM setup.

[error] 33#33: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 172.22.0.1, server: _, request: "GET /client/invoice/*string o letters*/download?t=1632577607998 HTTP/1.0", upstream: "fastcgi://172.22.0.3:9000", host: "invoice.*my website url ommited*", referrer: "https://invoice.*my website url omitted*/"

As far as I understand it, all the credentials are correct and I have been able to send through gmail, however when using my own mail server these are the errors I’m getting.

Hi,

I’m not sure, you may want to try using telnet to ensure the network is reachable.

Also, the info here may help: https://www.digitalocean.com/community/questions/connect-failed-111-connection-refused-while-connecting-to-upstream

Ok. I’ve had a look at that. I wasn’t getting a lot of useful information from it. However I did a little bit of exploring and I’ve ensured that my dns nameserver on ubuntu 20.04 is established as my router (primary) and google (secondary). I am able to nslookup the domain (locally hosted) address and a non authoritative answer shows the fqdn and IP address. However not able to ping.

Ping is often disabled, better to use telnet on the mail port.

It seems like it’s most likely a configuration issue.

unable to telnet. I’ve conducted a traceroute both on my local machine which points directly to the VM with IN.V5 but when trying a trace route or telnet inside the VM I’m not progressing anywhere. Traceroute just shows that it’s hitting the gateway (my router) and that’s it.

@david do you have any ideas?

networking inside docker isn’t a strength of mine. The only thing I would recommend is attempting to telnet FROM the VM to the mail server. if you can telnet from the VM, then the issue is a networking issue between the docker container and the VM.

Ok. So I did a bit more digging around.
I changed my router default primary DNS address from google to it’s own internal resolution service.
Modified resolv.conf entries inside the VM.
Restarted docker docker and rebooted the entire VM and I’ve managed to start the process of sending emails. This also helped with being able to have a payment gateway working as well.

I’m still getting some 500 errors on client portal, but that’s a problem for another day. It’s not a perfect solution, but it’s something that works for now.