myl-discovery 0.5.3__tar.gz → 0.5.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. myl-discovery-0.5.3/README.md → myl-discovery-0.5.4/HACKING.md +0 -20
  2. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/PKG-INFO +65 -103
  3. myl-discovery-0.5.4/README.md +89 -0
  4. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/PKG-INFO +65 -103
  5. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/SOURCES.txt +1 -0
  6. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myldiscovery/__init__.py +8 -3
  7. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/pyproject.toml +1 -1
  8. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/.github/dependabot.yml +0 -0
  9. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/.github/workflows/lint.yaml +0 -0
  10. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/.github/workflows/pypi.yaml +0 -0
  11. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/.github/workflows/release.yaml +0 -0
  12. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/.gitignore +0 -0
  13. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/LICENSE +0 -0
  14. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/dependency_links.txt +0 -0
  15. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/entry_points.txt +0 -0
  16. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/requires.txt +0 -0
  17. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myl_discovery.egg-info/top_level.txt +0 -0
  18. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myldiscovery/__main__.py +0 -0
  19. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myldiscovery/discovery.py +0 -0
  20. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/myldiscovery/main.py +0 -0
  21. {myl-discovery-0.5.3 → myl-discovery-0.5.4}/setup.cfg +0 -0
@@ -1,23 +1,3 @@
1
- # myl-discovery
2
-
3
- Email autoconfig library
4
-
5
- ## Installation
6
-
7
- ```shell
8
- pip install myl-discovery
9
- ```
10
-
11
- ## Usage
12
-
13
- ```python
14
- from myldiscovery import autodiscover
15
- autodiscover("me@example.com")
16
- # {'imap': {'server': 'mail.example.com', 'port': 993, 'starttls': False},
17
- # 'smtp': {'server': 'mail.example.com', 'port': 587, 'starttls': False}}
18
- ```
19
-
20
-
21
1
  ## Development
22
2
 
23
3
  ### Autodiscovery
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl-discovery
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: email autodiscovery
5
5
  Author-email: Philipp Schmitt <philipp@schmitt.co>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -684,130 +684,92 @@ Requires-Python: >=3.8
684
684
  Description-Content-Type: text/markdown
685
685
  License-File: LICENSE
686
686
 
687
- # myl-discovery
687
+ # 📩 myl-discovery
688
688
 
689
- Email autoconfig library
689
+ myl-discovery is a Python library designed to detect email settings of a given
690
+ email address or domain.
690
691
 
691
- ## Installation
692
+ ## 📥 Installation
692
693
 
693
- ```shell
694
+ To install myl-discovery, run the following command:
695
+
696
+ ```bash
694
697
  pip install myl-discovery
695
698
  ```
696
699
 
697
- ## Usage
700
+ ## 📖 Usage
701
+
702
+ After installing the package, you can use the `autodiscover` function to
703
+ discover the email settings for a domain. Here's an example:
698
704
 
699
705
  ```python
700
706
  from myldiscovery import autodiscover
701
- autodiscover("me@example.com")
702
- # {'imap': {'server': 'mail.example.com', 'port': 993, 'starttls': False},
703
- # 'smtp': {'server': 'mail.example.com', 'port': 587, 'starttls': False}}
704
- ```
705
-
706
707
 
707
- ## Development
708
+ settings = autodiscover("yourdomain.com") # or me@yourdomain.com
709
+ print(settings)
708
710
 
709
- ### Autodiscovery
710
-
711
- #### autoconfig
712
-
713
- ```shell
714
- curl -L https://mail.example.com/mail/config-v1.1.xml
711
+ # For Exchange autodiscovery you need to provide credentials
712
+ settings = autodiscover(
713
+ 'me@yourdomain.com',
714
+ username='WORKGROUP\me',
715
+ password='mypassword1234'
716
+ )
715
717
  ```
716
718
 
717
- Response:
718
-
719
- ```xml
720
- <?xml version="1.0" encoding="UTF-8"?>
721
- <clientConfig version="1.1">
722
- <emailProvider id="example.com">
723
- <domain>example.com</domain>
719
+ ## 📄 Output
724
720
 
725
- <displayName>example.com Email</displayName>
726
- <displayShortName>%EMAILLOCALPART%</displayShortName>
727
- <incomingServer type="imap">
728
- <hostname>mail.example.com</hostname>
729
- <port>143</port>
730
- <socketType>STARTTLS</socketType>
731
- <authentication>password-cleartext</authentication>
732
- <username>%EMAILADDRESS%</username>
733
- </incomingServer>
734
- <outgoingServer type="smtp">
735
- <hostname>mail.example.com</hostname>
736
- <port>587</port>
737
- <socketType>STARTTLS</socketType>
738
- <authentication>password-cleartext</authentication>
739
- <username>%EMAILADDRESS%</username>
740
- </outgoingServer>
741
- <documentation url="https://autodiscover.example.com">
742
- <descr lang="en">Generic settings page</descr>
743
- <descr lang="fr">Paramètres généraux</descr>
744
- <descr lang="es">Configuraciones genéricas</descr>
745
- <descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
746
- <descr lang="ru">Страница общих настроек</descr>
747
- </documentation>
748
- </emailProvider>
749
- </clientConfig>
750
- ```
721
+ The `autodiscover` function returns a dictionary with the detected settings.
722
+ The dictionary contains two keys, `imap` and `smtp`, each containing a
723
+ dictionary with the keys `server`, `port`, and `starttls`.
751
724
 
752
- ### autodiscover
725
+ Here's an example:
753
726
 
754
- ```shell
755
- curl -L mail.example.com/autodiscover/autodiscover.xml
727
+ ```json
728
+ {
729
+ "imap": {
730
+ "server": "imap.yourdomain.com",
731
+ "port": 993,
732
+ "starttls": false
733
+ },
734
+ "smtp": {
735
+ "server": "smtp.yourdomain.com",
736
+ "port": 587,
737
+ "starttls": true
738
+ }
739
+ }
756
740
  ```
757
741
 
758
- Response:
759
-
760
- ```xml
761
- <?xml version="1.0" encoding="utf-8" ?>
762
- <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
763
- <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
764
- <User>
765
- <DisplayName>example.com Email</DisplayName>
766
- </User>
767
- <Account>
768
- <AccountType>email</AccountType>
769
- <Action>settings</Action>
770
- <ServiceHome>https://autodiscover.example.com</ServiceHome>
771
-
772
- <Protocol>
773
- <Type>IMAP</Type>
774
- <TTL>1</TTL>
775
-
776
- <Server>mail.example.com</Server>
777
- <Port>143</Port>
742
+ ## 🧩 Autodiscover Functions
778
743
 
779
- <LoginName></LoginName>
744
+ myl-discovery exposes several functions to discover email settings:
780
745
 
781
- <DomainRequired>on</DomainRequired>
782
- <DomainName>example.com</DomainName>
746
+ - `autodiscover`: This function wraps the below function do automatically detect
747
+ the right settings. (See Autodiscover strategy for more information)
748
+ - `autodiscover_srv`: This function attempts to resolve SRV records for
749
+ the domain to discover IMAP and SMTP servers.
750
+ - `autodiscover_exchange`: This function attempts to use the Exchange
751
+ Autodiscover service to discover email settings. It requires a username and
752
+ password.
753
+ - `autodiscover_autoconfig`: This function attempts to fetch and parse an
754
+ autoconfig XML file from a URL specified in the domain's TXT records.
755
+ - `autodiscover_port_scan`: This function performs a port scan on the domain
756
+ to discover open IMAP and SMTP ports.
783
757
 
784
- <SPA>off</SPA>
785
- <Encryption>TLS</Encryption>
786
- <AuthRequired>on</AuthRequired>
787
- </Protocol>
788
- </Account>
789
- <Account>
790
- <AccountType>email</AccountType>
791
- <Action>settings</Action>
792
- <ServiceHome>https://autodiscover.example.com</ServiceHome>
758
+ ## 🧠 Autodiscover Strategy
793
759
 
794
- <Protocol>
795
- <Type>SMTP</Type>
796
- <TTL>1</TTL>
760
+ The `autodiscover` function uses the following strategy to discover
761
+ email settings:
797
762
 
798
- <Server>mail.example.com</Server>
799
- <Port>587</Port>
763
+ 1. It first attempts to use `autodiscover_autoconfig` to discover settings
764
+ from an autoconfig/autodiscover URL specified in the domain's TXT records.
765
+ 2. If that fails, it attempts to use `autodiscover_srv` to discover settings
766
+ from the domain's SRV records.
767
+ 3. If that fails and a password is provided, it attempts to use
768
+ `autodiscover_exchange` to discover settings using the
769
+ Exchange Autodiscover service (only if credentials were provided)
770
+ 4. If all else fails, it uses `autodiscover_port_scan` to discover settings by
771
+ performing a port scan on the domain.
800
772
 
801
- <LoginName></LoginName>
802
-
803
- <DomainRequired>on</DomainRequired>
804
- <DomainName>example.com</DomainName>
805
-
806
- <SPA>off</SPA>
807
- <Encryption>TLS</Encryption>
808
- <AuthRequired>on</AuthRequired>
809
- </Protocol>
810
- </Account></Response>
811
- </Autodiscover>
812
- ```
773
+ ## 📜 License
813
774
 
775
+ myl-discovery is licensed under the [GNU General Public License v3.0](LICENSE).
@@ -0,0 +1,89 @@
1
+ # 📩 myl-discovery
2
+
3
+ myl-discovery is a Python library designed to detect email settings of a given
4
+ email address or domain.
5
+
6
+ ## 📥 Installation
7
+
8
+ To install myl-discovery, run the following command:
9
+
10
+ ```bash
11
+ pip install myl-discovery
12
+ ```
13
+
14
+ ## 📖 Usage
15
+
16
+ After installing the package, you can use the `autodiscover` function to
17
+ discover the email settings for a domain. Here's an example:
18
+
19
+ ```python
20
+ from myldiscovery import autodiscover
21
+
22
+ settings = autodiscover("yourdomain.com") # or me@yourdomain.com
23
+ print(settings)
24
+
25
+ # For Exchange autodiscovery you need to provide credentials
26
+ settings = autodiscover(
27
+ 'me@yourdomain.com',
28
+ username='WORKGROUP\me',
29
+ password='mypassword1234'
30
+ )
31
+ ```
32
+
33
+ ## 📄 Output
34
+
35
+ The `autodiscover` function returns a dictionary with the detected settings.
36
+ The dictionary contains two keys, `imap` and `smtp`, each containing a
37
+ dictionary with the keys `server`, `port`, and `starttls`.
38
+
39
+ Here's an example:
40
+
41
+ ```json
42
+ {
43
+ "imap": {
44
+ "server": "imap.yourdomain.com",
45
+ "port": 993,
46
+ "starttls": false
47
+ },
48
+ "smtp": {
49
+ "server": "smtp.yourdomain.com",
50
+ "port": 587,
51
+ "starttls": true
52
+ }
53
+ }
54
+ ```
55
+
56
+ ## 🧩 Autodiscover Functions
57
+
58
+ myl-discovery exposes several functions to discover email settings:
59
+
60
+ - `autodiscover`: This function wraps the below function do automatically detect
61
+ the right settings. (See Autodiscover strategy for more information)
62
+ - `autodiscover_srv`: This function attempts to resolve SRV records for
63
+ the domain to discover IMAP and SMTP servers.
64
+ - `autodiscover_exchange`: This function attempts to use the Exchange
65
+ Autodiscover service to discover email settings. It requires a username and
66
+ password.
67
+ - `autodiscover_autoconfig`: This function attempts to fetch and parse an
68
+ autoconfig XML file from a URL specified in the domain's TXT records.
69
+ - `autodiscover_port_scan`: This function performs a port scan on the domain
70
+ to discover open IMAP and SMTP ports.
71
+
72
+ ## 🧠 Autodiscover Strategy
73
+
74
+ The `autodiscover` function uses the following strategy to discover
75
+ email settings:
76
+
77
+ 1. It first attempts to use `autodiscover_autoconfig` to discover settings
78
+ from an autoconfig/autodiscover URL specified in the domain's TXT records.
79
+ 2. If that fails, it attempts to use `autodiscover_srv` to discover settings
80
+ from the domain's SRV records.
81
+ 3. If that fails and a password is provided, it attempts to use
82
+ `autodiscover_exchange` to discover settings using the
83
+ Exchange Autodiscover service (only if credentials were provided)
84
+ 4. If all else fails, it uses `autodiscover_port_scan` to discover settings by
85
+ performing a port scan on the domain.
86
+
87
+ ## 📜 License
88
+
89
+ myl-discovery is licensed under the [GNU General Public License v3.0](LICENSE).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl-discovery
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: email autodiscovery
5
5
  Author-email: Philipp Schmitt <philipp@schmitt.co>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -684,130 +684,92 @@ Requires-Python: >=3.8
684
684
  Description-Content-Type: text/markdown
685
685
  License-File: LICENSE
686
686
 
687
- # myl-discovery
687
+ # 📩 myl-discovery
688
688
 
689
- Email autoconfig library
689
+ myl-discovery is a Python library designed to detect email settings of a given
690
+ email address or domain.
690
691
 
691
- ## Installation
692
+ ## 📥 Installation
692
693
 
693
- ```shell
694
+ To install myl-discovery, run the following command:
695
+
696
+ ```bash
694
697
  pip install myl-discovery
695
698
  ```
696
699
 
697
- ## Usage
700
+ ## 📖 Usage
701
+
702
+ After installing the package, you can use the `autodiscover` function to
703
+ discover the email settings for a domain. Here's an example:
698
704
 
699
705
  ```python
700
706
  from myldiscovery import autodiscover
701
- autodiscover("me@example.com")
702
- # {'imap': {'server': 'mail.example.com', 'port': 993, 'starttls': False},
703
- # 'smtp': {'server': 'mail.example.com', 'port': 587, 'starttls': False}}
704
- ```
705
-
706
707
 
707
- ## Development
708
+ settings = autodiscover("yourdomain.com") # or me@yourdomain.com
709
+ print(settings)
708
710
 
709
- ### Autodiscovery
710
-
711
- #### autoconfig
712
-
713
- ```shell
714
- curl -L https://mail.example.com/mail/config-v1.1.xml
711
+ # For Exchange autodiscovery you need to provide credentials
712
+ settings = autodiscover(
713
+ 'me@yourdomain.com',
714
+ username='WORKGROUP\me',
715
+ password='mypassword1234'
716
+ )
715
717
  ```
716
718
 
717
- Response:
718
-
719
- ```xml
720
- <?xml version="1.0" encoding="UTF-8"?>
721
- <clientConfig version="1.1">
722
- <emailProvider id="example.com">
723
- <domain>example.com</domain>
719
+ ## 📄 Output
724
720
 
725
- <displayName>example.com Email</displayName>
726
- <displayShortName>%EMAILLOCALPART%</displayShortName>
727
- <incomingServer type="imap">
728
- <hostname>mail.example.com</hostname>
729
- <port>143</port>
730
- <socketType>STARTTLS</socketType>
731
- <authentication>password-cleartext</authentication>
732
- <username>%EMAILADDRESS%</username>
733
- </incomingServer>
734
- <outgoingServer type="smtp">
735
- <hostname>mail.example.com</hostname>
736
- <port>587</port>
737
- <socketType>STARTTLS</socketType>
738
- <authentication>password-cleartext</authentication>
739
- <username>%EMAILADDRESS%</username>
740
- </outgoingServer>
741
- <documentation url="https://autodiscover.example.com">
742
- <descr lang="en">Generic settings page</descr>
743
- <descr lang="fr">Paramètres généraux</descr>
744
- <descr lang="es">Configuraciones genéricas</descr>
745
- <descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
746
- <descr lang="ru">Страница общих настроек</descr>
747
- </documentation>
748
- </emailProvider>
749
- </clientConfig>
750
- ```
721
+ The `autodiscover` function returns a dictionary with the detected settings.
722
+ The dictionary contains two keys, `imap` and `smtp`, each containing a
723
+ dictionary with the keys `server`, `port`, and `starttls`.
751
724
 
752
- ### autodiscover
725
+ Here's an example:
753
726
 
754
- ```shell
755
- curl -L mail.example.com/autodiscover/autodiscover.xml
727
+ ```json
728
+ {
729
+ "imap": {
730
+ "server": "imap.yourdomain.com",
731
+ "port": 993,
732
+ "starttls": false
733
+ },
734
+ "smtp": {
735
+ "server": "smtp.yourdomain.com",
736
+ "port": 587,
737
+ "starttls": true
738
+ }
739
+ }
756
740
  ```
757
741
 
758
- Response:
759
-
760
- ```xml
761
- <?xml version="1.0" encoding="utf-8" ?>
762
- <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
763
- <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
764
- <User>
765
- <DisplayName>example.com Email</DisplayName>
766
- </User>
767
- <Account>
768
- <AccountType>email</AccountType>
769
- <Action>settings</Action>
770
- <ServiceHome>https://autodiscover.example.com</ServiceHome>
771
-
772
- <Protocol>
773
- <Type>IMAP</Type>
774
- <TTL>1</TTL>
775
-
776
- <Server>mail.example.com</Server>
777
- <Port>143</Port>
742
+ ## 🧩 Autodiscover Functions
778
743
 
779
- <LoginName></LoginName>
744
+ myl-discovery exposes several functions to discover email settings:
780
745
 
781
- <DomainRequired>on</DomainRequired>
782
- <DomainName>example.com</DomainName>
746
+ - `autodiscover`: This function wraps the below function do automatically detect
747
+ the right settings. (See Autodiscover strategy for more information)
748
+ - `autodiscover_srv`: This function attempts to resolve SRV records for
749
+ the domain to discover IMAP and SMTP servers.
750
+ - `autodiscover_exchange`: This function attempts to use the Exchange
751
+ Autodiscover service to discover email settings. It requires a username and
752
+ password.
753
+ - `autodiscover_autoconfig`: This function attempts to fetch and parse an
754
+ autoconfig XML file from a URL specified in the domain's TXT records.
755
+ - `autodiscover_port_scan`: This function performs a port scan on the domain
756
+ to discover open IMAP and SMTP ports.
783
757
 
784
- <SPA>off</SPA>
785
- <Encryption>TLS</Encryption>
786
- <AuthRequired>on</AuthRequired>
787
- </Protocol>
788
- </Account>
789
- <Account>
790
- <AccountType>email</AccountType>
791
- <Action>settings</Action>
792
- <ServiceHome>https://autodiscover.example.com</ServiceHome>
758
+ ## 🧠 Autodiscover Strategy
793
759
 
794
- <Protocol>
795
- <Type>SMTP</Type>
796
- <TTL>1</TTL>
760
+ The `autodiscover` function uses the following strategy to discover
761
+ email settings:
797
762
 
798
- <Server>mail.example.com</Server>
799
- <Port>587</Port>
763
+ 1. It first attempts to use `autodiscover_autoconfig` to discover settings
764
+ from an autoconfig/autodiscover URL specified in the domain's TXT records.
765
+ 2. If that fails, it attempts to use `autodiscover_srv` to discover settings
766
+ from the domain's SRV records.
767
+ 3. If that fails and a password is provided, it attempts to use
768
+ `autodiscover_exchange` to discover settings using the
769
+ Exchange Autodiscover service (only if credentials were provided)
770
+ 4. If all else fails, it uses `autodiscover_port_scan` to discover settings by
771
+ performing a port scan on the domain.
800
772
 
801
- <LoginName></LoginName>
802
-
803
- <DomainRequired>on</DomainRequired>
804
- <DomainName>example.com</DomainName>
805
-
806
- <SPA>off</SPA>
807
- <Encryption>TLS</Encryption>
808
- <AuthRequired>on</AuthRequired>
809
- </Protocol>
810
- </Account></Response>
811
- </Autodiscover>
812
- ```
773
+ ## 📜 License
813
774
 
775
+ myl-discovery is licensed under the [GNU General Public License v3.0](LICENSE).
@@ -1,4 +1,5 @@
1
1
  .gitignore
2
+ HACKING.md
2
3
  LICENSE
3
4
  README.md
4
5
  pyproject.toml
@@ -1,6 +1,11 @@
1
- from .discovery import (autodiscover, autodiscover_autoconfig,
2
- autodiscover_exchange, autodiscover_port_scan,
3
- autodiscover_srv, autodiscover_txt)
1
+ from .discovery import (
2
+ autodiscover,
3
+ autodiscover_autoconfig,
4
+ autodiscover_exchange,
5
+ autodiscover_port_scan,
6
+ autodiscover_srv,
7
+ autodiscover_txt,
8
+ )
4
9
  from .main import main
5
10
 
6
11
  __all__ = [
@@ -22,7 +22,7 @@ dependencies = [
22
22
  "rich == 13.4.2",
23
23
  "xmltodict == 0.13.0"
24
24
  ]
25
- version = "0.5.3"
25
+ version = "0.5.4"
26
26
 
27
27
  [project.scripts]
28
28
  myl-discovery = "myldiscovery:main"
File without changes
File without changes
File without changes