SMTP configuration never connects to server

Description

Hello,
I have SMTP configured to connect to the localhost on port 2525, but I never see a connection to it when I attempt to send mail from rocket.chat. SMTP mail is working fine from the command line and I can send and receive email that way to/from any domain. I have the SMTP server in the email settings set to 127.0.0.1 (have also tried localhost) and the port set to 2525. I have tried a few iterations of changes stopping and restarting the server in between each time. I see a call to an API in the rocket log, but never any connection to the SMTP mail server is logged. The mailserver is Postfix 3.6.4

Server Setup Information

  • Version of Rocket.Chat Server: 7.7.0
  • Operating System: Linux Pop!OS
  • Deployment Method: docker compose
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 22.14.0 - x64
  • MongoDB Version: wiredTiger
  • Proxy: nginx
  • Firewalls involved: None

Any additional Information

“API”,“method”:“POST”,“url”:“http://localhost/api/v1/method.call/sendSMTPTestEmail
“status”:200,“responseTime”:38

Thank you for your time.

You are using docker.

127.0.0.1 inside the container points… to inside the container (unless you are using host mode) not the actual host.

You need to contact the server outside the container at whatever it’s real IP is eg 192.168.0.1

You probably ought to spend some time reading the docker docs to understand how it works.

Well, of course it is, now don’t I feel stupid. I possibly would have figured that out if there were an error posted into the log. The 200 status made me believe the post worked. Thanks for setting me straight.

NP.

Note. It isn’t something Rocket can really tell you…

You told it to use 127.0.0.1 which it did. Just not the 127.0.0.1 you were thinking of.

It told you it couldn’t connect, because it couldn’t.

And it has no idea about docker or docker networks or bridges so can’t tell you more.

This is about understanding the tools you use. Docker has a thousand horrible habits and you should get to understand them if you are using it.

That is my point, it did not say it couldn’t connect, status 200 is OK.