myl-discovery 0.5.3__py3-none-any.whl → 0.5.4__py3-none-any.whl
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.
- {myl_discovery-0.5.3.dist-info → myl_discovery-0.5.4.dist-info}/METADATA +65 -103
- myl_discovery-0.5.4.dist-info/RECORD +10 -0
- myldiscovery/__init__.py +8 -3
- myl_discovery-0.5.3.dist-info/RECORD +0 -10
- {myl_discovery-0.5.3.dist-info → myl_discovery-0.5.4.dist-info}/LICENSE +0 -0
- {myl_discovery-0.5.3.dist-info → myl_discovery-0.5.4.dist-info}/WHEEL +0 -0
- {myl_discovery-0.5.3.dist-info → myl_discovery-0.5.4.dist-info}/entry_points.txt +0 -0
- {myl_discovery-0.5.3.dist-info → myl_discovery-0.5.4.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: myl-discovery
|
3
|
-
Version: 0.5.
|
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
|
@@ -689,130 +689,92 @@ Requires-Dist: requests (==2.31.0)
|
|
689
689
|
Requires-Dist: rich (==13.4.2)
|
690
690
|
Requires-Dist: xmltodict (==0.13.0)
|
691
691
|
|
692
|
-
# myl-discovery
|
692
|
+
# 📩 myl-discovery
|
693
693
|
|
694
|
-
|
694
|
+
myl-discovery is a Python library designed to detect email settings of a given
|
695
|
+
email address or domain.
|
695
696
|
|
696
|
-
## Installation
|
697
|
+
## 📥 Installation
|
697
698
|
|
698
|
-
|
699
|
+
To install myl-discovery, run the following command:
|
700
|
+
|
701
|
+
```bash
|
699
702
|
pip install myl-discovery
|
700
703
|
```
|
701
704
|
|
702
|
-
## Usage
|
705
|
+
## 📖 Usage
|
706
|
+
|
707
|
+
After installing the package, you can use the `autodiscover` function to
|
708
|
+
discover the email settings for a domain. Here's an example:
|
703
709
|
|
704
710
|
```python
|
705
711
|
from myldiscovery import autodiscover
|
706
|
-
autodiscover("me@example.com")
|
707
|
-
# {'imap': {'server': 'mail.example.com', 'port': 993, 'starttls': False},
|
708
|
-
# 'smtp': {'server': 'mail.example.com', 'port': 587, 'starttls': False}}
|
709
|
-
```
|
710
|
-
|
711
712
|
|
712
|
-
|
713
|
+
settings = autodiscover("yourdomain.com") # or me@yourdomain.com
|
714
|
+
print(settings)
|
713
715
|
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
716
|
+
# For Exchange autodiscovery you need to provide credentials
|
717
|
+
settings = autodiscover(
|
718
|
+
'me@yourdomain.com',
|
719
|
+
username='WORKGROUP\me',
|
720
|
+
password='mypassword1234'
|
721
|
+
)
|
720
722
|
```
|
721
723
|
|
722
|
-
|
723
|
-
|
724
|
-
```xml
|
725
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
726
|
-
<clientConfig version="1.1">
|
727
|
-
<emailProvider id="example.com">
|
728
|
-
<domain>example.com</domain>
|
724
|
+
## 📄 Output
|
729
725
|
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
<hostname>mail.example.com</hostname>
|
734
|
-
<port>143</port>
|
735
|
-
<socketType>STARTTLS</socketType>
|
736
|
-
<authentication>password-cleartext</authentication>
|
737
|
-
<username>%EMAILADDRESS%</username>
|
738
|
-
</incomingServer>
|
739
|
-
<outgoingServer type="smtp">
|
740
|
-
<hostname>mail.example.com</hostname>
|
741
|
-
<port>587</port>
|
742
|
-
<socketType>STARTTLS</socketType>
|
743
|
-
<authentication>password-cleartext</authentication>
|
744
|
-
<username>%EMAILADDRESS%</username>
|
745
|
-
</outgoingServer>
|
746
|
-
<documentation url="https://autodiscover.example.com">
|
747
|
-
<descr lang="en">Generic settings page</descr>
|
748
|
-
<descr lang="fr">Paramètres généraux</descr>
|
749
|
-
<descr lang="es">Configuraciones genéricas</descr>
|
750
|
-
<descr lang="de">Allgemeine Beschreibung der Einstellungen</descr>
|
751
|
-
<descr lang="ru">Страница общих настроек</descr>
|
752
|
-
</documentation>
|
753
|
-
</emailProvider>
|
754
|
-
</clientConfig>
|
755
|
-
```
|
726
|
+
The `autodiscover` function returns a dictionary with the detected settings.
|
727
|
+
The dictionary contains two keys, `imap` and `smtp`, each containing a
|
728
|
+
dictionary with the keys `server`, `port`, and `starttls`.
|
756
729
|
|
757
|
-
|
730
|
+
Here's an example:
|
758
731
|
|
759
|
-
```
|
760
|
-
|
732
|
+
```json
|
733
|
+
{
|
734
|
+
"imap": {
|
735
|
+
"server": "imap.yourdomain.com",
|
736
|
+
"port": 993,
|
737
|
+
"starttls": false
|
738
|
+
},
|
739
|
+
"smtp": {
|
740
|
+
"server": "smtp.yourdomain.com",
|
741
|
+
"port": 587,
|
742
|
+
"starttls": true
|
743
|
+
}
|
744
|
+
}
|
761
745
|
```
|
762
746
|
|
763
|
-
|
764
|
-
|
765
|
-
```xml
|
766
|
-
<?xml version="1.0" encoding="utf-8" ?>
|
767
|
-
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
|
768
|
-
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
|
769
|
-
<User>
|
770
|
-
<DisplayName>example.com Email</DisplayName>
|
771
|
-
</User>
|
772
|
-
<Account>
|
773
|
-
<AccountType>email</AccountType>
|
774
|
-
<Action>settings</Action>
|
775
|
-
<ServiceHome>https://autodiscover.example.com</ServiceHome>
|
776
|
-
|
777
|
-
<Protocol>
|
778
|
-
<Type>IMAP</Type>
|
779
|
-
<TTL>1</TTL>
|
780
|
-
|
781
|
-
<Server>mail.example.com</Server>
|
782
|
-
<Port>143</Port>
|
747
|
+
## 🧩 Autodiscover Functions
|
783
748
|
|
784
|
-
|
749
|
+
myl-discovery exposes several functions to discover email settings:
|
785
750
|
|
786
|
-
|
787
|
-
|
751
|
+
- `autodiscover`: This function wraps the below function do automatically detect
|
752
|
+
the right settings. (See Autodiscover strategy for more information)
|
753
|
+
- `autodiscover_srv`: This function attempts to resolve SRV records for
|
754
|
+
the domain to discover IMAP and SMTP servers.
|
755
|
+
- `autodiscover_exchange`: This function attempts to use the Exchange
|
756
|
+
Autodiscover service to discover email settings. It requires a username and
|
757
|
+
password.
|
758
|
+
- `autodiscover_autoconfig`: This function attempts to fetch and parse an
|
759
|
+
autoconfig XML file from a URL specified in the domain's TXT records.
|
760
|
+
- `autodiscover_port_scan`: This function performs a port scan on the domain
|
761
|
+
to discover open IMAP and SMTP ports.
|
788
762
|
|
789
|
-
|
790
|
-
<Encryption>TLS</Encryption>
|
791
|
-
<AuthRequired>on</AuthRequired>
|
792
|
-
</Protocol>
|
793
|
-
</Account>
|
794
|
-
<Account>
|
795
|
-
<AccountType>email</AccountType>
|
796
|
-
<Action>settings</Action>
|
797
|
-
<ServiceHome>https://autodiscover.example.com</ServiceHome>
|
763
|
+
## 🧠 Autodiscover Strategy
|
798
764
|
|
799
|
-
|
800
|
-
|
801
|
-
<TTL>1</TTL>
|
765
|
+
The `autodiscover` function uses the following strategy to discover
|
766
|
+
email settings:
|
802
767
|
|
803
|
-
|
804
|
-
|
768
|
+
1. It first attempts to use `autodiscover_autoconfig` to discover settings
|
769
|
+
from an autoconfig/autodiscover URL specified in the domain's TXT records.
|
770
|
+
2. If that fails, it attempts to use `autodiscover_srv` to discover settings
|
771
|
+
from the domain's SRV records.
|
772
|
+
3. If that fails and a password is provided, it attempts to use
|
773
|
+
`autodiscover_exchange` to discover settings using the
|
774
|
+
Exchange Autodiscover service (only if credentials were provided)
|
775
|
+
4. If all else fails, it uses `autodiscover_port_scan` to discover settings by
|
776
|
+
performing a port scan on the domain.
|
805
777
|
|
806
|
-
|
807
|
-
|
808
|
-
<DomainRequired>on</DomainRequired>
|
809
|
-
<DomainName>example.com</DomainName>
|
810
|
-
|
811
|
-
<SPA>off</SPA>
|
812
|
-
<Encryption>TLS</Encryption>
|
813
|
-
<AuthRequired>on</AuthRequired>
|
814
|
-
</Protocol>
|
815
|
-
</Account></Response>
|
816
|
-
</Autodiscover>
|
817
|
-
```
|
778
|
+
## 📜 License
|
818
779
|
|
780
|
+
myl-discovery is licensed under the [GNU General Public License v3.0](LICENSE).
|
@@ -0,0 +1,10 @@
|
|
1
|
+
myldiscovery/__init__.py,sha256=L_XVC06ZVdjhnV5up1MBnywTuGUIyjt8PUoQDUOzfAk,381
|
2
|
+
myldiscovery/__main__.py,sha256=5BjNuyet8AY-POwoF5rGt722rHQ7tJ0Vf0UFUfzzi-I,58
|
3
|
+
myldiscovery/discovery.py,sha256=YnEJ54CdwaA6PluMSC0ba7uGhoM__-ejtPTCawa9cto,7358
|
4
|
+
myldiscovery/main.py,sha256=dBvJULlnULiJOCtios2hF1A2lNu6EWMKpTSjC9fs2Ss,2016
|
5
|
+
myl_discovery-0.5.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
+
myl_discovery-0.5.4.dist-info/METADATA,sha256=Bj7FHNAlBwBWSDj3JF6-enWBXe-dpzbszClTWe9n7tk,43775
|
7
|
+
myl_discovery-0.5.4.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
8
|
+
myl_discovery-0.5.4.dist-info/entry_points.txt,sha256=nyyAyvgvu6iO9mPEA6uVrPfd0lIrUyo9AQWeH2asEY0,52
|
9
|
+
myl_discovery-0.5.4.dist-info/top_level.txt,sha256=v_h72JexaacqBNY6iOMD9PpGg8lnGoL-pkmUIzxdiVU,13
|
10
|
+
myl_discovery-0.5.4.dist-info/RECORD,,
|
myldiscovery/__init__.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
from .discovery import (
|
2
|
-
|
3
|
-
|
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__ = [
|
@@ -1,10 +0,0 @@
|
|
1
|
-
myldiscovery/__init__.py,sha256=ULYoSzXVfqGzJ8SAuKaHmBH-_gbeLHKdzr4z5T-I2Lk,402
|
2
|
-
myldiscovery/__main__.py,sha256=5BjNuyet8AY-POwoF5rGt722rHQ7tJ0Vf0UFUfzzi-I,58
|
3
|
-
myldiscovery/discovery.py,sha256=YnEJ54CdwaA6PluMSC0ba7uGhoM__-ejtPTCawa9cto,7358
|
4
|
-
myldiscovery/main.py,sha256=dBvJULlnULiJOCtios2hF1A2lNu6EWMKpTSjC9fs2Ss,2016
|
5
|
-
myl_discovery-0.5.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
-
myl_discovery-0.5.3.dist-info/METADATA,sha256=MzF3YMpHSnfhVQOJenx5Jxjz4As4DDQcJ0ZEtdb_FrA,44965
|
7
|
-
myl_discovery-0.5.3.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
8
|
-
myl_discovery-0.5.3.dist-info/entry_points.txt,sha256=nyyAyvgvu6iO9mPEA6uVrPfd0lIrUyo9AQWeH2asEY0,52
|
9
|
-
myl_discovery-0.5.3.dist-info/top_level.txt,sha256=v_h72JexaacqBNY6iOMD9PpGg8lnGoL-pkmUIzxdiVU,13
|
10
|
-
myl_discovery-0.5.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|