{"id":16612918,"url":"https://github.com/ttys3/smtp-brd","last_synced_at":"2025-10-05T07:45:17.505Z","repository":{"id":64318779,"uuid":"254877871","full_name":"ttys3/smtp-brd","owner":"ttys3","description":"smtp bridge for apps which want to send email in the traditional SMTP way but actully goes to the WEB API ","archived":false,"fork":false,"pushed_at":"2025-01-08T15:49:01.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T11:41:46.358Z","etag":null,"topics":["bridge","mailgun","sendgrid","smtp"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/80x86/smtp-brd","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttys3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-11T13:50:26.000Z","updated_at":"2025-01-08T15:48:58.000Z","dependencies_parsed_at":"2025-01-09T01:30:34.484Z","dependency_job_id":null,"html_url":"https://github.com/ttys3/smtp-brd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ttys3/smtp-brd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsmtp-brd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsmtp-brd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsmtp-brd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsmtp-brd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttys3","download_url":"https://codeload.github.com/ttys3/smtp-brd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsmtp-brd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425464,"owners_count":25984685,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bridge","mailgun","sendgrid","smtp"],"created_at":"2024-10-12T01:45:20.674Z","updated_at":"2025-10-05T07:45:17.464Z","avatar_url":"https://github.com/ttys3.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smtp-brd\n\n![build_container_image](https://github.com/ttys3/smtp-brd/workflows/build_container_image/badge.svg?branch=ctr)\n![test_lint](https://github.com/ttys3/smtp-brd/workflows/test_lint/badge.svg?branch=master)\n\n## description\n\nthe main goal of this project is setup as a side container\n\nfor remark42 comment system to send email via `WEB API`\n\n- RFC compliance minimal SMTP server\n- TLS support\n- Authentication support ( LOGIN | PLAIN | CRAM-MD5 mechanisms that obeys RFC 4954)\n- Forward mail sending request to providers ( mailgun | sendgrid )\n- Easily run with Docker or Podman \u003chttps://hub.docker.com/r/80x86/smtp-brd\u003e\n\n## available providers\n\n```ini\nmailgun\nsendgrid\n```\n\n## run with podman\n\n### run with kube pod\n\n```\nwget https://github.com/ttys3/smtp-brd/raw/master/smtpbrd-pod.yaml\n# edit smtpbrd-pod.yaml as your need\nsudo podman play kube smtpbrd-pod.yaml\n```\n\n### run with cli\n\n```bash\nsudo podman run -d --name smtpbrd -p 2525:2525 \\\n-e BRD_PROVIDER=sendgrid \\\n-e BRD_SENDGRID_API_KEY='SG-KEY-HERE' \\\n80x86/smtp-brd:latest\n```\n\n## run with Docker\n\n### run wich docker compose\n\n```bash\nwget https://github.com/ttys3/smtp-brd/raw/master/docker-compose.yml\n# edit docker-compose.yml as your need\ndocker-compose -f docker-compose.yml up -d\n```\n\n### run with cli\n```bash\nsudo docker run -d --name smtpbrd -p 2525:2525 \\\n-e BRD_PROVIDER=sendgrid \\\n-e BRD_SENDGRID_API_KEY='SG-KEY-HERE' \\\n80x86/smtp-brd:latest\n```\n\n## config\n\nthere are 3 ways to config\n\n- the config.toml file\n- environment variables\n- command line interface parameters\n\ntake `mailgun.api_key` for example:\n\nconfig.toml\n\n```toml\n# Mailgun\n[mailgun]\napi_key = \"\"\n```\n\nthe equal environment variable is `BRD_MAINGUN_API_KEY`\nbe aware here we introduced a prefix `BRD_` to avoid conflict\n\nthe equal cli param is `--mailgun.api_key`\n\nrun `smtp-brd --help` for full config options\n\nthe `environment variables` is recommend way for running in container.\n\n## available config env vars and their default value\n\n### general env vars\n\n```ini\n    BRD_ADDR=\"0.0.0.0\"\n    BRD_PORT=\"2525\"\n    BRD_TLS=false\n    BRD_CERT=\"/etc/brd/ssl/ssl.crt\"\n    BRD_KEY=\"/etc/brd/ssl/ssl.key\"\n    BRD_DEBUG=false\n    BRD_USER=\"\"\n    BRD_SECRET=\"\"\n    BRD_PROVIDER=\"mailgun\"\n```\n\n### system related base env vars\n\n```ini\nTZ=Asia/Hong_Kong\nPUID=1000\nPGID=1000\n```\n\nyou can run the container in your own timezone,\njust to specific the env var, for example:\n\n```ini\nTZ=America/Los_Angeles\n```\n\n### provider related env vars\n\n`mailgun` provider\n```ini\n    BRD_MAILGUN_API_KEY=\"\"\n    BRD_MAILGUN_DOMAIN=\"\"\n    BRD_MAILGUN_TIMEOUT=10\n```\n\n`sendgrid` provider\n\n```ini\n    BRD_SENDGRID_API_KEY=\"\"\n    BRD_SENDGRID_TIMEOUT=10\n```\n\n## TODO\n\n- more tests\n\n## TLS\n\ndefault certificate stores under `/etc/brd/ssl`\n\nhowever in container, you can map it to any path as you like\n\njust set the correct value for `BRD_CERT` and `BRD_KEY`\n\n## FAQ\n\n1. `smtp.plainAuth failed: unencrypted connection`\n\n    You need either to setup TLS on your SMTP server,\n    use localhost as a relay or disable authentication.\n    the answer come from  \n    [this issue](https://github.com/prometheus/alertmanager/issues/1358#issuecomment-386209698)\n\n    The error is because the Go SMTP package doesn't allow authentication without encryption.\n    From \u003chttps://godoc.org/net/smtp#PlainAuth\u003e\n\n    \u003e   PlainAuth will only send the credentials if the connection is using TLS\n        or is connected to localhost. Otherwise authentication\n        will fail with an error, without sending the credentials.\n\n2. got `x509: certificate signed by unknown authority` error while TLS enabled\n\n    The error is because the Go net/smtp client tls.Config.InsecureSkipVerify is enforced to true\n\n    if TLS enabled, be sure your have valid certificate\n\n    self-signed cert is not allowed by golang smtp client\n\n## thanks\n\n**mail parser** this project use `github.com/veqryn/go-email/email` to parse email  \n[repo](https://github.com/veqryn/go-email/email)\n\n**minimal SMTP server** use `github.com/mhale/smtpd` [repo](https://github.com/mhale/smtpd),  \nwhich seems based on the work of [Brad Fitzpatrick's go-smtpd](https://github.com/bradfitz/go-smtpd)\n\n**flags parser** `github.com/spf13/pflag` [repo](https://github.com/spf13/pflag)\n\n**config manager** `github.com/spf13/viper` [repo](https://github.com/spf13/viper)\n\n**logger** `go.uber.org/zap` [repo](https://github.com/uber-go/zap)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fsmtp-brd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttys3%2Fsmtp-brd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fsmtp-brd/lists"}