mailsuite 2.3.0__tar.gz → 2.3.2__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.
- {mailsuite-2.3.0 → mailsuite-2.3.2}/PKG-INFO +2 -2
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/__init__.py +1 -1
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/utils.py +8 -3
- {mailsuite-2.3.0 → mailsuite-2.3.2}/pyproject.toml +1 -1
- {mailsuite-2.3.0 → mailsuite-2.3.2}/.gitignore +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/LICENSE +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/README.md +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/arc.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/dkim.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/imap.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/__init__.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/base.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/gmail.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/graph.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/imap.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/mailbox/maildir.py +0 -0
- {mailsuite-2.3.0 → mailsuite-2.3.2}/mailsuite/smtp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mailsuite
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: A Python package for retrieving, parsing, and sending emails
|
|
5
5
|
Project-URL: Homepage, https://github.com/seanthegeek/mailsuite/
|
|
6
6
|
Project-URL: Documentation, https://seanthegeek.net/mailsuite/
|
|
@@ -28,7 +28,7 @@ Requires-Dist: dkimpy>=1.1.0
|
|
|
28
28
|
Requires-Dist: dnspython>=2.0.0
|
|
29
29
|
Requires-Dist: expiringdict==1.2.2
|
|
30
30
|
Requires-Dist: html2text>=2020.1.16
|
|
31
|
-
Requires-Dist: imapclient>=
|
|
31
|
+
Requires-Dist: imapclient>=4.0.0
|
|
32
32
|
Requires-Dist: mail-parser>=4.6.2
|
|
33
33
|
Requires-Dist: publicsuffix2>=2.20190812
|
|
34
34
|
Provides-Extra: all
|
|
@@ -361,8 +361,10 @@ def parse_email(
|
|
|
361
361
|
|
|
362
362
|
_parsed_email = mailparser.parse_from_string(data_str)
|
|
363
363
|
parsed_email = _parsed_email.mail
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
# mail-parser <=4.6.1 returns the input string for unparseable input;
|
|
365
|
+
# 4.6.2+ returns a dict with no headers instead.
|
|
366
|
+
if isinstance(parsed_email, str) or not _parsed_email.headers:
|
|
367
|
+
raise ValueError("Not an email")
|
|
366
368
|
headers_str = re.split(r"(\n|\r\n){2,}", data_str)[0]
|
|
367
369
|
parsed_email["raw_headers"] = headers_str
|
|
368
370
|
headers_str = re.sub(r"(\n|\r\n)\s+", " ", headers_str)
|
|
@@ -400,7 +402,10 @@ def parse_email(
|
|
|
400
402
|
parsed_email[header] = [parse_email_address(x) for x in email.utils.getaddresses([_headers[header]])]
|
|
401
403
|
from_domain = None
|
|
402
404
|
if "from" in parsed_email:
|
|
403
|
-
if
|
|
405
|
+
if (
|
|
406
|
+
parsed_email["from"] is not None
|
|
407
|
+
and "domain" in parsed_email["from"]
|
|
408
|
+
):
|
|
404
409
|
from_domain = parsed_email["from"]["domain"]
|
|
405
410
|
else:
|
|
406
411
|
logger.warning("Message from header could not be parsed")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|