{"id":51300753,"url":"https://github.com/solarssk/mail-autodiscover","last_synced_at":"2026-06-30T19:30:32.669Z","repository":{"id":363820909,"uuid":"1265076512","full_name":"solarssk/mail-autodiscover","owner":"solarssk","description":"Lightweight Outlook Autodiscover, Thunderbird Autoconfig and Apple Mail profile service for self-hosted mail servers.","archived":false,"fork":false,"pushed_at":"2026-06-20T12:19:20.000Z","size":238,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T13:25:35.908Z","etag":null,"topics":["apple-mail","autoconfig","autodiscover","docker","fastapi","imap","mail","mailplus","outlook","self-hosted","smtp","synology","thunderbird"],"latest_commit_sha":null,"homepage":"https://github.com/solarssk/mail-autodiscover","language":"Python","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/solarssk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T12:50:01.000Z","updated_at":"2026-06-20T12:15:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/solarssk/mail-autodiscover","commit_stats":null,"previous_names":["solarssk/autodiscover","solarssk/mail-autodiscover"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/solarssk/mail-autodiscover","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarssk%2Fmail-autodiscover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarssk%2Fmail-autodiscover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarssk%2Fmail-autodiscover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarssk%2Fmail-autodiscover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solarssk","download_url":"https://codeload.github.com/solarssk/mail-autodiscover/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarssk%2Fmail-autodiscover/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34981389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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":["apple-mail","autoconfig","autodiscover","docker","fastapi","imap","mail","mailplus","outlook","self-hosted","smtp","synology","thunderbird"],"created_at":"2026-06-30T19:30:31.720Z","updated_at":"2026-06-30T19:30:32.660Z","avatar_url":"https://github.com/solarssk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mail-autodiscover\n\n`mail-autodiscover` is a small deploy-and-forget HTTP service for self-hosted mail admins.\n\nIt exposes standard autodiscovery endpoints for:\n\n- Outlook Autodiscover\n- Thunderbird Autoconfig\n- Apple Mail `.mobileconfig`\n- POP3 in Thunderbird config when enabled for a domain\n\nThe product goal is deliberately narrow:\n\n- stateless container\n- no admin panel\n- no database\n- no mailbox existence checks\n- no LDAP / Synology / directory lookups\n\nIf you want a small service you can deploy behind HTTPS and mostly forget about, this is what it is for.\n\n## What It Does\n\nFor any syntactically valid mailbox in an allowed domain, the service returns the configured IMAP/SMTP settings and, optionally, POP3 for Thunderbird.\n\nIt does **not**:\n\n- verify whether a mailbox exists\n- expose your internal domain list on the landing page\n- return different answers for existing vs non-existing mailboxes\n- manage users or credentials\n\n## Quick Start\n\n1. Copy [`.env.example`](.env.example) to `.env`.\n2. Choose one configuration mode:\n   - single/global config in ENV\n   - multi-domain config in [`config/config.example.yaml`](config/config.example.yaml)\n3. Deploy with Docker Compose or Portainer.\n4. Put the service behind HTTPS reverse proxy.\n5. Point `autodiscover.` and `autoconfig.` DNS records to that proxy.\n6. Test the endpoints before sharing them with users.\n\n### Single-Domain Or Shared Global Config\n\n```env\nAPP_ENV=production\nPUBLIC_BASE_URL=https://autodiscover.example.com\nALLOWED_DOMAINS=example.com,example.org\nMAIL_DISPLAY_NAME=Example Mail\nMAIL_DISPLAY_SHORT_NAME=Example\nIMAP_HOST=mail.example.com\nIMAP_PORT=993\nIMAP_SOCKET_TYPE=SSL\nSMTP_HOST=mail.example.com\nSMTP_PORT=587\nSMTP_SOCKET_TYPE=STARTTLS\nPOP3_ENABLED=false\nTRUST_PROXY_HEADERS=true\nTRUSTED_PROXY_IPS=127.0.0.1,10.0.0.0/8\n```\n\nThis mode serves the same IMAP/SMTP profile for every domain listed in `ALLOWED_DOMAINS`.\n\n### Multi-Domain Config File\n\nSet:\n\n```env\nCONFIG_FILE=/config/config.yaml\n```\n\nThen mount a file like [`config/config.example.yaml`](config/config.example.yaml).\n\nIf `CONFIG_FILE` exists, domain settings are loaded from YAML and the application ignores the global `ALLOWED_DOMAINS`/`IMAP_*`/`SMTP_*` values for request routing.\n\n`USERNAME_FORMAT` is not per-domain in YAML mode; it still comes from ENV and applies to every configured domain.\n\n## Docker / Portainer\n\nFor local builds:\n\n```bash\ndocker compose up -d\n```\n\nFor GHCR images:\n\n```bash\ndocker compose -f docker-compose.ghcr.yml up -d\n```\n\nThe compose examples mount `./config:/config:ro`, so placing `config/config.yaml` next to the compose file is enough for multi-domain mode.\n\nPrebuilt images are published to GHCR:\n\n```text\nghcr.io/solarssk/mail-autodiscover:latest\nghcr.io/solarssk/mail-autodiscover:0.3.2\n```\n\nPrefer pinned tags or digests in production.\n\n## Reverse Proxy Contract\n\n- `TRUST_PROXY_HEADERS=false` is the safe default.\n- Enable `TRUST_PROXY_HEADERS=true` only when traffic really arrives through your own proxy.\n- In production, `TRUSTED_PROXY_IPS` is required whenever proxy header trust is enabled.\n- Thunderbird and Apple Mail use `?emailaddress=user@example.com` in the query string.\n\nImportant:\n\nYour reverse proxy may log the full query string even though this application does not. Review access log settings for:\n\n- `/mail/config-v1.1.xml`\n- `/.well-known/autoconfig/mail/config-v1.1.xml`\n- `/mail/ios.mobileconfig`\n- `/.well-known/apple-mail.mobileconfig`\n\n## Endpoints\n\n| Method | Path | Purpose |\n|--------|------|---------|\n| `GET` | `/health` | Liveness probe |\n| `GET` | `/ready` | Readiness probe |\n| `GET` | `/` | Minimal landing page |\n| `GET` | `/robots.txt` | No-index hint |\n| `GET` | `/mail/config-v1.1.xml?emailaddress=...` | Thunderbird Autoconfig |\n| `GET` | `/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=...` | Thunderbird alias |\n| `GET` | `/mail/ios.mobileconfig?emailaddress=...` | Apple Mail profile |\n| `GET` | `/.well-known/apple-mail.mobileconfig?emailaddress=...` | Apple Mail alias |\n| `POST` | `/autodiscover/autodiscover.xml` | Outlook Autodiscover |\n| `GET` | `/autodiscover/autodiscover.xml` | Neutral Outlook response |\n\n## Apple Mail Notes\n\n- Profiles are unsigned by default.\n- iOS and macOS warn about unsigned profiles in self-hosted setups; this is expected.\n- Profiles never contain mailbox passwords.\n- Re-downloading the same mailbox profile updates the existing profile because identifiers are stable.\n- If you need signed profiles, sign them externally before distribution.\n\n## Logging And Observability\n\n- `X-Request-ID` is attached to responses and access logs.\n- Access logs never include the full mailbox address.\n- `STRUCTURED_JSON_LOGS=true` switches access logging to JSON.\n- `/metrics` is intentionally not built in.\n\n## Documentation\n\n- [Reverse Proxy and DNS](docs/dns.md)\n- [Nginx](docs/reverse-proxy/nginx.md)\n- [Caddy](docs/reverse-proxy/caddy.md)\n- [Nginx Proxy Manager](docs/reverse-proxy/nginx-proxy-manager.md)\n- [Synology Reverse Proxy](docs/reverse-proxy/synology-reverse-proxy.md)\n- [Cloudflare Tunnel / Generic Proxy](docs/reverse-proxy/cloudflare-tunnel.md)\n- [Outlook client setup](docs/clients/outlook.md)\n- [Thunderbird client setup](docs/clients/thunderbird.md)\n- [Apple Mail client setup](docs/clients/apple-mail.md)\n- [Troubleshooting](docs/troubleshooting.md)\n\n## Security At A Glance\n\n- no mailbox enumeration\n- no full email address logging\n- safe XML parsing\n- bounded in-memory rate limiting\n- security headers enabled by default\n- no admin API\n\nSee [SECURITY.md](SECURITY.md) for the detailed trust model.\n\n## Local Development\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install \".[dev]\"\npre-commit install\ncp .env.example .env\nuvicorn app.main:app --host 0.0.0.0 --port 8000 --no-access-log --reload\n```\n\nFor development with placeholder values, set `APP_ENV=test` or `APP_ENV=development`.\n\n## Quality Checks\n\nRun the same Python checks as GitHub CI:\n\n```bash\n./scripts/check.sh\n```\n\n`pre-commit install` also runs `ruff`, `mypy`, and `pytest` automatically before each commit.\n\nDeveloper workflow and release process live in [`CONTRIBUTING.md`](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarssk%2Fmail-autodiscover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolarssk%2Fmail-autodiscover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarssk%2Fmail-autodiscover/lists"}