Simple library for email connection parameters discovery
Project description
maildiscover
Simple python library for email connection parameters discovery
What for?
This library aims to provide a simple way to retrieve email configuration
parameters (for SMTP
/submission
, POP3
and IMAP
servers). Currently, it
does so implementing the autoconfig Mozilla protocol and a special
dns lookup.
NOTE: I also considered trying to implement the autodiscover flow from Microsoft, but I wasn't able to make it work.
How to use it?
Install its latest version from pypi
pip install maildiscover
Then, import it into your project. You can either use the provided get
function, that tries all the known methods and returns a merged version of the
found data:
import maildiscover
result = maildiscover.get("myself@example.com")
Or you can use any specific method independently
import maildiscover
dns_method = maildiscover.DNSSRV("myself@example.com")
ac_method = maildiscover.Autoconfig("myself@example.com")
dns_result = dns_method.get()
ac_result = ac_method.get()
The method may raise, either if it fails (in such case they raise
MethodFailed
) or if the provided email is malformed, then they raise
MaformedEmail
.
In case of success, the returned data is a custom dataclass, that can be
converted back to a dict with the to_dict
method, with self-explaining
fields.
Contacts
If you want to suggest a change or propose a patch, don't hesitate to drop me an
email at blallo -|AT|- autistici.org
. I am friendly :)
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
Hashes for maildiscover-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06878bad5e67fb65cb476f0d7f830e14d07ce346f8be28d9545e665d67c85528 |
|
MD5 | 65e36482fa4b026fce6f1cbf64a7a3e9 |
|
BLAKE2b-256 | 04cd72e8402662c922f2f6d8f3a602aea82a3a863b0f36d0cd3f0736a776e243 |