Skip to content

Commit

Permalink
8.14.0 release
Browse files Browse the repository at this point in the history
- Fix processing of SMTP-TLS reports (#549)
- Skip invalid aggregate report rows without calling the whole report invalid
  - Some providers such as GoDaddy will send reports with some rows missing a source IP address, while other rows are fine
- Fix Dovecot support by using the seperator provided by the IPMAP namespace when possible (PR #552 closes #551)
- Only download `base_reverse_dns_map.csv` once (fixes #542)
- Update included `base_reverse_dns_map.csv`
  - Replace University category with Education to be more inclusive
- Update included `dbip-country-lite.mmdb`
  • Loading branch information
seanthegeek committed Sep 3, 2024
1 parent fc36a78 commit 21180f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
8.14.0
------

- Fix processing of SMTP-TLS reports (#549)
- Skip invalid aggregate report rows without calling the whole report invalid
- Some providers such as GoDaddy will send reports with some rows missing a source IP address, while other rows are fine
- Fix Dovecot support by using the seperator provided by the IPMAP namespace when possible (PR #552 closes #551)
Expand Down
13 changes: 4 additions & 9 deletions parsedmarc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,18 +597,13 @@ def extract_report(input_):
str: The extracted text
"""
def is_base64(s):
base64_regex = re.compile(r'^[A-Za-z0-9+/=]+\Z')
return bool(base64_regex.match(s))

try:
file_object = None
if isinstance(input_, str):
if is_base64(input_):
try:
file_object = BytesIO(b64decode(input_))
except binascii.Error:
pass
try:
file_object = BytesIO(b64decode(input_))
except binascii.Error:
pass
else:
file_object = open(input_, "rb")
elif type(input_) is bytes:
Expand Down

0 comments on commit 21180f4

Please sign in to comment.