# SMTP configuration never connects to server

**URL:** <https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244>\
**Category:** Community Support\
**Created:** [June 14, 2025, 7:47am UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244 "2025-06-14T07:47:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwachtve](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dwachtve](https://forums.rocket.chat/u/dwachtve)\
**Post date:** [June 14, 2025, 7:47am UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244/1 "2025-06-14T07:47:18Z")

</div>

### 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](http://localhost/api/v1/method.call/sendSMTPTestEmail)”  
“status”:200,“responseTime”:38

 ![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/0/068384e9fc0f9aebf8e8a753c0af19a51482abfd.png)

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [June 14, 2025, 11:41am UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244/2 "2025-06-14T11:41:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dwachtve](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dwachtve](https://forums.rocket.chat/u/dwachtve)\
**Post date:** [June 14, 2025, 3:11pm UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244/3 "2025-06-14T15:11:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [June 14, 2025, 4:55pm UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244/4 "2025-06-14T16:55:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dwachtve](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dwachtve](https://forums.rocket.chat/u/dwachtve)\
**Post date:** [June 14, 2025, 8:14pm UTC](https://forums.rocket.chat/t/smtp-configuration-never-connects-to-server/22244/5 "2025-06-14T20:14:33Z")

</div>

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