# Set up a SMTP server for Docker

**URL:** https://forums.rocket.chat/t/set-up-a-smtp-server-for-docker/6499
**Category:** Community Support
**Created:** [April 13, 2020, 9:30am UTC](https://forums.rocket.chat/t/set-up-a-smtp-server-for-docker/6499 "2020-04-13T09:30:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ESCRACLE](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@ESCRACLE](https://forums.rocket.chat/u/ESCRACLE)
#### Post date: [April 13, 2020, 9:30am UTC](https://forums.rocket.chat/t/set-up-a-smtp-server-for-docker/6499/1 "2020-04-13T09:30:53Z")

</div>

### Description

I am trying to set up a SMTP server for my Rocket.Chat instance on Docker.

By setting Gmail SMTP setting (based on [this site](https://www.siteground.com/kb/google_free_smtp_server/)) it sends email to participants correctly. The port 25 is open, nothing wrong with nodeserver.

What I want to do here is to replace the Gmail SMTP server to something that you can set up on your own server, such as Postfix.

Since a couple of days I have tried [docker-postfix](https://hub.docker.com/r/catatnight/postfix/), still no luck.

```auto
 $ sudo docker run -d -p 25:25 \
         -e maildomain=mail.example.com -e smtp_user=user:pwd \
         --name postfix catatnight/postfix

```

I tried `user` and `pwd` with `mail.example.com` (replacing them with mine), but it did not work due to the error below:

```auto
Exception in defer callback: Error: Greeting never received at SMTPConnection._formatError (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/node4mailer/lib/smtp-connection/index.js:558:19) at SMTPConnection._onError (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/node4mailer/lib/smtp-connection/index.js:531:20) at Timeout.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/email/node_modules/node4mailer/lib/smtp-connection/index.js:472:22) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7) { code: 'ETIMEDOUT', command: 'CONN' } 

```

I know something is wrong with my setting.

Any help is very appreciated. Thanks,

### Server Setup Information

- Version of Rocket.Chat Server: 3.0.7
- Operating System: Debian
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 10.15.2
- MongoDB Version: 4.0
- Proxy: nginx
- Firewalls involved: ufw.

### Any additional Information
