dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

[Mailcatcher] 220 EventMachine SMTP Server

Open itsa-sh opened this issue 6 years ago • 0 comments

When using Docker-compose trying to send email to mailcatcher from a separate container gets Connection refused. However if I test this via netcat I get the following error:

220 EventMachine SMTP Server

If I test the connection from my host it works, just inside of a docker network container to container.

nc -z 127.0.0.1 1025 Connection to 127.0.0.1 port 1025 [tcp/blackjack] succeeded! nc -z 127.0.0.1 1080 Connection to 127.0.0.1 port 1080 [tcp/socks] succeeded!

The version of docker/compose is:

Docker version 18.09.0, build 4d60db4
docker-compose version 1.23.2, build 1110ad01

An example of the docker-compose.yml below:

version: '3.2'
services:

  php:
    image: example/trusty:php70
    ports:
      - 9000
    volumes:
      - .:/var/www
    networks:
      - internal

  mailcatcher:
    image: schickling/mailcatcher:latest
    ports:
      - "${DOCKER_PORT_MAILCATCHER_SMTP}:1025"
      - "${DOCKER_PORT_MAILCATCHER_HTTP}:1080"
    networks:
      - internal

networks:
  internal:

The values for the environments are as follows:

# .env content
DOCKER_PORT_MAILCATCHER_SMTP=1025
DOCKER_PORT_MAILCATCHER_HTTP=1080

itsa-sh avatar Jan 24 '19 09:01 itsa-sh