Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maildiscover-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

maildiscover-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file maildiscover-0.1.0.tar.gz.

File metadata

  • Download URL: maildiscover-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for maildiscover-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c13245b68064912396c46f233e2d5fa6ab54a5a33f04fffd67bd14951704c216
MD5 c2fd19fb7f13d2743ba0e3c316e197fb
BLAKE2b-256 e458e08745dac8ca552e65548da27f36da1d97b42556b9ab12df029d4e43ee43

See more details on using hashes here.

File details

Details for the file maildiscover-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: maildiscover-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for maildiscover-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06878bad5e67fb65cb476f0d7f830e14d07ce346f8be28d9545e665d67c85528
MD5 65e36482fa4b026fce6f1cbf64a7a3e9
BLAKE2b-256 04cd72e8402662c922f2f6d8f3a602aea82a3a863b0f36d0cd3f0736a776e243

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page