{"id":16615581,"url":"https://github.com/pschmitt/myl-discovery","last_synced_at":"2026-02-26T17:02:14.616Z","repository":{"id":175082449,"uuid":"653315133","full_name":"pschmitt/myl-discovery","owner":"pschmitt","description":"Email autoconfig library","archived":false,"fork":false,"pushed_at":"2024-10-29T18:38:40.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T20:38:18.623Z","etag":null,"topics":["autoconfig","autodiscover","autodiscovery","email","email-configuration"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/myl-discovery/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschmitt.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},"funding":{"github":["pschmitt"],"custom":["https://www.paypal.com/paypalme/pppschmitt"]}},"created_at":"2023-06-13T20:24:49.000Z","updated_at":"2024-10-29T18:38:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"b25f2b4b-08e4-4dc6-aff0-8e7a4e4d1bdd","html_url":"https://github.com/pschmitt/myl-discovery","commit_stats":null,"previous_names":["pschmitt/myl-discovery"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fmyl-discovery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fmyl-discovery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fmyl-discovery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Fmyl-discovery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschmitt","download_url":"https://codeload.github.com/pschmitt/myl-discovery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224982995,"owners_count":17402404,"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":["autoconfig","autodiscover","autodiscovery","email","email-configuration"],"created_at":"2024-10-12T02:09:55.557Z","updated_at":"2026-02-26T17:02:09.579Z","avatar_url":"https://github.com/pschmitt.png","language":"Python","funding_links":["https://github.com/sponsors/pschmitt","https://www.paypal.com/paypalme/pppschmitt"],"categories":[],"sub_categories":[],"readme":"# 📩 myl-discovery\n\nmyl-discovery is a Python library designed to detect email settings of a given\nemail address or domain.\n\n## 📥 Installation\n\nTo install myl-discovery, run the following command:\n\n```bash\npip install myl-discovery\n```\n\n## 📖 Usage\n\nAfter installing the package, you can use the `autodiscover` function to\ndiscover the email settings for a domain. Here's an example:\n\n```python\nfrom myldiscovery import autodiscover\n\nsettings = autodiscover(\"yourdomain.com\")  # or me@yourdomain.com\nprint(settings)\n\n# For Exchange autodiscovery you need to provide credentials\nsettings = autodiscover(\n    'me@yourdomain.com',\n    username='WORKGROUP\\me',\n    password='mypassword1234'\n)\n```\n\n## 📄 Output\n\nThe `autodiscover` function returns a dictionary with the detected settings.\nThe dictionary contains two keys, `imap` and `smtp`, each containing a\ndictionary with the keys `server`, `port`, and `starttls`.\n\nHere's an example:\n\n```json\n{\n  \"imap\": {\n    \"server\": \"imap.yourdomain.com\",\n    \"port\": 993,\n    \"starttls\": false,\n    \"ssl\": false\n  },\n  \"smtp\": {\n    \"server\": \"smtp.yourdomain.com\",\n    \"port\": 587,\n    \"starttls\": true,\n    \"ssl\": false\n  }\n}\n```\n\n## 🧩 Autodiscover Functions\n\nmyl-discovery exposes several functions to discover email settings:\n\n- `autodiscover`: This function wraps the below function do automatically detect\nthe right settings. (See Autodiscover strategy for more information)\n- `autodiscover_srv`: This function attempts to resolve SRV records for\nthe domain to discover IMAP and SMTP servers.\n- `autodiscover_exchange`: This function attempts to use the Exchange\nAutodiscover service to discover email settings. It requires a username and\npassword.\n- `autodiscover_autoconfig`: This function attempts to fetch and parse an\nautoconfig XML file from a URL specified in the domain's TXT records.\n- `autodiscover_port_scan`: This function performs a port scan on the domain\nto discover open IMAP and SMTP ports.\n\n## 🧠 Autodiscover Strategy\n\nThe `autodiscover` function uses the following strategy to discover\nemail settings:\n\n1. It first attempts to use `autodiscover_autoconfig` to discover settings\nfrom an autoconfig/autodiscover URL specified in the domain's TXT records.\n2. If that fails, it attempts to use `autodiscover_srv` to discover settings\nfrom the domain's SRV records.\n3. If that fails and a password is provided, it attempts to use\n`autodiscover_exchange` to discover settings using the\nExchange Autodiscover service (only if credentials were provided)\n4. If all else fails, it uses `autodiscover_port_scan` to discover settings by\nperforming a port scan on the domain.\n\n## 💻 CLI usage\n\nIf you do not intend to use the Python library and just want to detect the\nconnection settings of an arbitrary email, myl-discovery also ships with a\nCLI tool.\n\n### 📥 Installation\n\n```shell\npipx install myl-discovery\n```\n\n### 📖 Usage\n\n```\n$ myl-discovery --help\nusage: myl-discovery [-h] [-j] [-d] [-u USERNAME] [-p PASSWORD] EMAIL\n\npositional arguments:\n  EMAIL\n\noptions:\n  -h, --help            show this help message and exit\n  -j, --json\n  -d, --debug\n  -u USERNAME, --username USERNAME\n                        Username (Exchange only)\n  -p PASSWORD, --password PASSWORD\n                        Password (Exchange only)\n```\n\nExample:\n\n```\n$ myl-discovery user01@gmail.com\n Service          Host                           Port       Encryption\n imap             imap.gmail.com                 993        tls\n smtp             smtp.gmail.com                 587        tls\n```\n\n## 📜 License\n\nmyl-discovery is licensed under the [GNU General Public License v3.0](LICENSE).\n\n## 📑 Upstream docs\n\n- https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat\n- https://datatracker.ietf.org/doc/html/rfc6186\n- https://developers.google.com/gmail/imap/imap-smtp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Fmyl-discovery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschmitt%2Fmyl-discovery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Fmyl-discovery/lists"}