Skip to content

Allow use of privileged ports locally in Docker #328

@martinkoehler

Description

@martinkoehler

MailHog allows to configure the port where it listens e.g. via
the environment variable MH_SMTP_BIND_ADDR. However specifing a privileged ports does not work, since MailHog runs as normal user.

Usually you run a MailHog Dockercontainer and expose the ports via the host. However if you need to access the container from another Docker container via an internal network, this mapping does not work and the configured port must be used.

A scenario where this gives problems is the following:
Assume you have one container A that is configured to send mails via a smarthost named smtp.domain.com
Run MailHog as a Docker container.
Connect both container with an internal network N and set a Docker alias for the MailHog container assmtp.domain.com.
Then from A MailHog can be accessed via smtp.domain.com, but the port is the internal port of the Docker container. The original smtp.domain.com smarthost usually uses the privileged port 25. If Mailhog could be configured to listen on the port 25 internally, A could run unchanged and all mails would end up at MailHog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions