email autodiscovery
Project description
📩 myl-discovery
myl-discovery is a Python library designed to detect email settings of a given email address or domain.
📥 Installation
To install myl-discovery, run the following command:
pip install myl-discovery
📖 Usage
After installing the package, you can use the autodiscover function to
discover the email settings for a domain. Here's an example:
from myldiscovery import autodiscover
settings = autodiscover("yourdomain.com") # or me@yourdomain.com
print(settings)
# For Exchange autodiscovery you need to provide credentials
settings = autodiscover(
'me@yourdomain.com',
username='WORKGROUP\me',
password='mypassword1234'
)
📄 Output
The autodiscover function returns a dictionary with the detected settings.
The dictionary contains two keys, imap and smtp, each containing a
dictionary with the keys server, port, and starttls.
Here's an example:
{
"imap": {
"server": "imap.yourdomain.com",
"port": 993,
"starttls": false,
"ssl": false
},
"smtp": {
"server": "smtp.yourdomain.com",
"port": 587,
"starttls": true,
"ssl": false
}
}
🧩 Autodiscover Functions
myl-discovery exposes several functions to discover email settings:
autodiscover: This function wraps the below function do automatically detect the right settings. (See Autodiscover strategy for more information)autodiscover_srv: This function attempts to resolve SRV records for the domain to discover IMAP and SMTP servers.autodiscover_exchange: This function attempts to use the Exchange Autodiscover service to discover email settings. It requires a username and password.autodiscover_autoconfig: This function attempts to fetch and parse an autoconfig XML file from a URL specified in the domain's TXT records.autodiscover_port_scan: This function performs a port scan on the domain to discover open IMAP and SMTP ports.
🧠 Autodiscover Strategy
The autodiscover function uses the following strategy to discover
email settings:
- It first attempts to use
autodiscover_autoconfigto discover settings from an autoconfig/autodiscover URL specified in the domain's TXT records. - If that fails, it attempts to use
autodiscover_srvto discover settings from the domain's SRV records. - If that fails and a password is provided, it attempts to use
autodiscover_exchangeto discover settings using the Exchange Autodiscover service (only if credentials were provided) - If all else fails, it uses
autodiscover_port_scanto discover settings by performing a port scan on the domain.
💻 CLI usage
If you do not intend to use the Python library and just want to detect the connection settings of an arbitrary email, myl-discovery also ships with a CLI tool.
📥 Installation
pipx install myl-discovery
📖 Usage
$ myl-discovery --help
usage: myl-discovery [-h] [-j] [-d] [-u USERNAME] [-p PASSWORD] EMAIL
positional arguments:
EMAIL
options:
-h, --help show this help message and exit
-j, --json
-d, --debug
-u USERNAME, --username USERNAME
Username (Exchange only)
-p PASSWORD, --password PASSWORD
Password (Exchange only)
Example:
$ myl-discovery user01@gmail.com
Service Host Port Encryption
imap imap.gmail.com 993 tls
smtp smtp.gmail.com 587 tls
📜 License
myl-discovery is licensed under the GNU General Public License v3.0.
📑 Upstream docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myl_discovery-0.6.4.tar.gz.
File metadata
- Download URL: myl_discovery-0.6.4.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55338f1664376651cbf4e70e20b956c8d98b366494e05bef854827971daa6c5c
|
|
| MD5 |
a07d6592730fa1a6a49a78471776c381
|
|
| BLAKE2b-256 |
57d43a89520e10d11d5e6dab232df570bc9caee6ecf8a7b530467e12797c0739
|
Provenance
The following attestation bundles were made for myl_discovery-0.6.4.tar.gz:
Publisher:
pypi.yaml on pschmitt/myl-discovery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myl_discovery-0.6.4.tar.gz -
Subject digest:
55338f1664376651cbf4e70e20b956c8d98b366494e05bef854827971daa6c5c - Sigstore transparency entry: 701974114
- Sigstore integration time:
-
Permalink:
pschmitt/myl-discovery@d6da6de0c7ae0ba29108e702c8d458bd19177faa -
Branch / Tag:
refs/tags/0.6.4 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@d6da6de0c7ae0ba29108e702c8d458bd19177faa -
Trigger Event:
push
-
Statement type:
File details
Details for the file myl_discovery-0.6.4-py3-none-any.whl.
File metadata
- Download URL: myl_discovery-0.6.4-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11056342f480ca667313bc56f85d18f4e787fc26201ac8de79b426481d5d5096
|
|
| MD5 |
5dac7e99cb44f65cbaa330762ed54cf0
|
|
| BLAKE2b-256 |
d6caa385ded3fbe183c6feb72c2c6509607469bb8c00ed470264ab6f590b0bf2
|
Provenance
The following attestation bundles were made for myl_discovery-0.6.4-py3-none-any.whl:
Publisher:
pypi.yaml on pschmitt/myl-discovery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myl_discovery-0.6.4-py3-none-any.whl -
Subject digest:
11056342f480ca667313bc56f85d18f4e787fc26201ac8de79b426481d5d5096 - Sigstore transparency entry: 701974117
- Sigstore integration time:
-
Permalink:
pschmitt/myl-discovery@d6da6de0c7ae0ba29108e702c8d458bd19177faa -
Branch / Tag:
refs/tags/0.6.4 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@d6da6de0c7ae0ba29108e702c8d458bd19177faa -
Trigger Event:
push
-
Statement type: