{"id":28378093,"url":"https://github.com/kopernic-pl/harakahog","last_synced_at":"2026-01-28T14:32:56.469Z","repository":{"id":205592266,"uuid":"714612006","full_name":"kopernic-pl/harakahog","owner":"kopernic-pl","description":"Mailhog behind Haraka for STARTTLS","archived":false,"fork":false,"pushed_at":"2024-09-04T13:21:26.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T21:43:16.856Z","etag":null,"topics":["mailhog","proxy","tls-proxy"],"latest_commit_sha":null,"homepage":"","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/kopernic-pl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-11-05T11:43:30.000Z","updated_at":"2024-11-13T12:47:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"46a8b528-c849-49a4-8913-b3181dc566a4","html_url":"https://github.com/kopernic-pl/harakahog","commit_stats":null,"previous_names":["kopernic-pl/harakahog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kopernic-pl/harakahog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopernic-pl%2Fharakahog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopernic-pl%2Fharakahog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopernic-pl%2Fharakahog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopernic-pl%2Fharakahog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopernic-pl","download_url":"https://codeload.github.com/kopernic-pl/harakahog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopernic-pl%2Fharakahog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mailhog","proxy","tls-proxy"],"created_at":"2025-05-30T01:35:36.471Z","updated_at":"2026-01-28T14:32:56.463Z","avatar_url":"https://github.com/kopernic-pl.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# harakahog\nMailhog behind Haraka for STARTTLS\n\n## Problem statement\nFor QA purposes there is a need for a mailcatcher service that supports TLS. [MailHog](https://github.com/mailhog/MailHog) doesn't.\n\n## Solution\nLet us configure Haraka to operate behind a proper MTA that is capable of supporting STARTTLS in a secure manner.\nSpecifically, we will configure Haraka to:\n- utilize TLS encryption\n- only accept inbound relay connections from a pre-approved whitelist of IP addresses\n- use SMTP LOGIN auth solely over TLS\n- forward all received emails to the companion MailHog container within the same Docker Compose environment.\n\nFor this proof-of-concept, we will be using Docker Compose, although a Helm chart would also be a viable option.\n\n### To configure\nI'm proposing an approach that combines two types of relay authorization: IP ACL and SMTP user LOGIN type authZ.\n\nAlso, system will need some key and certificate.\n\n#### Prepare key and certificate\n\nRun \n\n```bash\nopenssl req -newkey rsa:2048 -nodes -keyform PEM -keyout tls_key.pem -outform PEM -x509 -days 365 -out tls_cert.pem\n```\nand answer certificate questions. Make sure that generated files are in `h-config` dir and `h-config\\tls.ini` file is pointing at them.\n\nFor commercial, non-self-signed certificate, one needs to construct a [certificate chain file](https://github.com/haraka/Haraka/wiki/Setting-up-TLS-with-CA-certificates).\n\n#### Prepare user credentials\nEdit `h-config/auth_flat_file.ini` and add some user with password there.\n\n#### Configure IP address ACL\nIf you want to enable IP address controller relay, add IP/range in CIDR notation to `h-config/relay_acl_allow`. One entry per line.\n\nAs an example - values for localhost and for MacOS docker internal network are already there.\n\n### To run\n\n`docker compose up`\n\nWhen run, there will be some files created in `h-config`, most notably `dhparams.pem` file and `me` server identity file.\n\n### To test\nSMTP over telnet is not *that* complicated but let's use `swaks` (https://github.com/jetmore/swaks) on MacOS.\n\n```bash\nbrew install swaks\n```\n\nAnd then let's send some test email\n```bash\nswaks --from asd@xyz.co --to x@asdffdsa.com --server localhost:587 -tls -a LOGIN\n```\n\n`-tls` option forces STARTTLS communucation. `-a LOGIN` forces LOGIN SMTP auth.\n\nRemember that haraka proxy is configured to allow relays from given whitelisted IP or after successful auth.\n\nSee the mailhog web ui (http://localhost:8025) to see received emails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopernic-pl%2Fharakahog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopernic-pl%2Fharakahog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopernic-pl%2Fharakahog/lists"}