Set up a SMTP server for Docker


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) 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, still no luck.

 $ sudo docker run -d -p 25:25 \
         -e -e smtp_user=user:pwd \
         --name postfix catatnight/postfix

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

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