{"id":18595904,"url":"https://github.com/42bv/docker-mailhog","last_synced_at":"2025-04-10T16:31:52.327Z","repository":{"id":144794940,"uuid":"99133050","full_name":"42BV/docker-mailhog","owner":"42BV","description":"MailHog SMTP Server in a Docker container","archived":false,"fork":false,"pushed_at":"2017-08-04T13:13:56.000Z","size":19,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-25T01:11:29.076Z","etag":null,"topics":["developer-tools","docker-container","dockerfile","mailhog","smtp-server"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/42bv/mailhog/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42BV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-02T15:33:43.000Z","updated_at":"2025-01-27T10:40:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca51a12c-5cb7-49ae-aacd-f96888dff869","html_url":"https://github.com/42BV/docker-mailhog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42BV%2Fdocker-mailhog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42BV%2Fdocker-mailhog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42BV%2Fdocker-mailhog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42BV%2Fdocker-mailhog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42BV","download_url":"https://codeload.github.com/42BV/docker-mailhog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252695,"owners_count":21072701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","docker-container","dockerfile","mailhog","smtp-server"],"created_at":"2024-11-07T01:22:12.139Z","updated_at":"2025-04-10T16:31:52.319Z","avatar_url":"https://github.com/42BV.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker Build Statu](https://img.shields.io/docker/build/42bv/mailhog.svg)](https://hub.docker.com/r/42bv/mailhog/builds/) ![Docker Stars](https://img.shields.io/docker/stars/42bv/mailhog.svg) [![Docker Pulls](https://img.shields.io/docker/pulls/42bv/mailhog.svg)](https://hub.docker.com/r/42bv/mailhog/) \n\n[![MailHog](https://github.com/42BV/docker-mailhog/blob/master/logo.png?raw=true)](https://github.com/mailhog/MailHog) \n\n# Docker - MailHog\n\nThe populair [MailHog](https://github.com/mailhog/MailHog) smtp server with a REST API and Web UI in a Docker container.\n\n- [mhsendmail](https://github.com/mailhog/mhsendmail) is included for sending test mails.\n- Optional save the messages to disk.\n- Based on the official [golang:alpine](https://hub.docker.com/_/golang/) image.\n\n---\n\n## Supported tags and Dockerfile\n\n- `latest`\n\n\n## Pull  \n\nGet the latest version:\n```\ndocker pull 42bv/mailhog:latest\n```\n\n## Build  \n\nClone the repository:\n```\ngit clone git@github.com:42BV/docker-mailhog.git\ncd docker-mailhog\n```\n\nBuild the current Dockerfile  and tag the image:   \n```\ndocker build -t mailhog .\n```\n\nBuild with a specific environment variable, for example STORAGE:   \n```\ndocker build --build-arg STORAGE=memory -t mailhog .\n```\n\n## Run\n  \nRun with default settings:\n```\ndocker run --rm -d -p 587:587 -p 8025:8025 --name mailhog 42bv/mailhog\n```\n\nRun with volume mounted to save messages to disk in Maildir format: \n```\ndocker run -d -p 587:587 -p 8025:8025 -v $PWD/Maildir:/srv/Maildir --name mailhog 42bv/mailhog\n```\n\n---\n\n## Deployment\n\nFor a production deployment you probably want to utilize a supervisor process to monitor the Docker container. \n\nFor a standalone installation, one of the most simple solutions is to use [systemd](https://www.freedesktop.org/wiki/Software/systemd/), which comes pre-installed with most modern Linux installations.\n\n#### Requirements\n\n* systemd\n* docker\n\n#### Installation\n\nPlace the systemd unit `mailhog.service` file in `/etc/systemd/system/`\n```\n[Unit]\nDescription=MailHog\nBindsTo==docker.service\nAfter=docker.service\nDocumentation=\"https://github.com/42BV/docker-mailhog\"\n\n[Service]\nRestart=always\nRestartSec=3\nExecStartPre=-/usr/bin/docker rm -f mailhog\nExecStart=/usr/bin/docker run --rm -p 587:587 -p 8025:8025 --name mailhog 42bv/mailhog:latest\nExecStop=-/usr/bin/docker stop mailhog\nExecStopPost=-/usr/bin/docker rm -f mailhog\n\n[Install]\nWantedBy=multi-user.target\n```\n\nReload systemd, scanning for new or changed units:\n```\nsystemctl daemon-reload\n```\n\nStart a unit immediately:\n```\nsystemctl start mailhog\n```\n\nEnable the service to be started on bootup:\n```\nsystemctl enable mailhog\n```\n\n---\n\n## Usage\n\n### MailHog UI\n\n#### Default\nOnce the container is running you can access the web UI at [http://localhost:8025](http://localhost:8025). \n\n#### Customize\nYou can change the mapped port by running the container with `-p 8000:8025` instead, or by building the Dockerfile with the `--build-arg UI_PORT=8000` for example.\n\n### Sending mails\n\n#### mhsendmail\n\nA sendmail replacement which forwards mail to an SMTP server. This tool is include in the Docker image. \n\nUse mhsendmail for sending test mails to your running MailHog instance:\n\n```\ndocker exec -i mailhog mhsendmail --smtp-addr=\"localhost:587\" \u003c\u003cEOF \nFrom: Me \u003cme@example.com\u003e\nTo: You \u003cyou@example.com\u003e\nSubject: Test Message\n\nHello there!\nEOF\n```\n\n### REST API\n\nSee the REST API documentation for more info.\n\n* [APIv2](https://github.com/mailhog/MailHog/blob/master/docs/APIv2.md)\n* [APIv1](https://github.com/mailhog/MailHog/blob/master/docs/APIv1.md)\n\n#### Curl\n\nSearch messages for containing a string, for example \"Hello\":\n```\ncurl -X \"GET\" http://localhost:8025/api/v2/search?kind=containing\u0026query=Hello \n```\n\nDelete all Messages:\n```\ncurl -X \"DELETE\" http://localhost:8025/api/v1/messages\n```\n\n### Project Integration\n\n#### Configuration\n\nConfigure your application to use MailHog for SMTP delivery.\n\n| Property  | Value     | Note     |\n|:--------- |:--------- | :------- |\n| HOSTNAME  | localhost | required |\n| PORT      | 587       | required |\n| USERNAME  |           | ignored  |\n| PASSWORD  |           | ignored  |\n| TLS       |           | ignored  |\n| SSL       |           | ignored  |\n\n#### Libraries\n\n* [APIv2 library for NodeJS](https://github.com/blueimp/mailhog-node)\n\n### Issues and limitations\n\n* No SSL or TLS support yet\n* No Java client yet\n\n---\n\n## License\n\nReleased under the [MIT license](https://github.com/42BV/docker-mailhog/blob/master/LICENSE.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42bv%2Fdocker-mailhog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42bv%2Fdocker-mailhog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42bv%2Fdocker-mailhog/lists"}