mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-02-17 07:03:58 +00:00
Fix if base_domain is None before get_service_from_reverse_dns_base_d… (#514)
* Fix if base_domain is None before get_service_from_reverse_dns_base_domain call - Added if statement for base_domain before getting get_service_from_reverse_dns_base_domain(). If base_domain is None, get_service_from_reverse_dns_base_domain() will fail the report. - Added .xml test file * Create protection.outlook.com!example.com!1711756800!1711843200.xml added .xml test sample report where base_domain return none
This commit is contained in:
@@ -403,16 +403,17 @@ def get_ip_address_info(ip_address,
|
|||||||
info["type"] = None
|
info["type"] = None
|
||||||
if reverse_dns is not None:
|
if reverse_dns is not None:
|
||||||
base_domain = get_base_domain(reverse_dns)
|
base_domain = get_base_domain(reverse_dns)
|
||||||
service = get_service_from_reverse_dns_base_domain(
|
if base_domain is not None:
|
||||||
base_domain,
|
service = get_service_from_reverse_dns_base_domain(
|
||||||
offline=offline,
|
base_domain,
|
||||||
local_file_path=reverse_dns_map_path,
|
offline=offline,
|
||||||
url=reverse_dns_map_url,
|
local_file_path=reverse_dns_map_path,
|
||||||
always_use_local_file=always_use_local_files,
|
url=reverse_dns_map_url,
|
||||||
reverse_dns_map=reverse_dns_map)
|
always_use_local_file=always_use_local_files,
|
||||||
info["base_domain"] = base_domain
|
reverse_dns_map=reverse_dns_map)
|
||||||
info["type"] = service["type"]
|
info["base_domain"] = base_domain
|
||||||
info["name"] = service["name"]
|
info["type"] = service["type"]
|
||||||
|
info["name"] = service["name"]
|
||||||
|
|
||||||
if cache is not None:
|
if cache is not None:
|
||||||
cache[ip_address] = info
|
cache[ip_address] = info
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<feedback xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<version>1.0</version>
|
||||||
|
<report_metadata>
|
||||||
|
<org_name>Outlook.com</org_name>
|
||||||
|
<email>dmarcreport@microsoft.com</email>
|
||||||
|
<report_id>cfeafefe4129445e8c81018bd9177197</report_id>
|
||||||
|
<date_range>
|
||||||
|
<begin>1711756800</begin>
|
||||||
|
<end>1711843200</end>
|
||||||
|
</date_range>
|
||||||
|
</report_metadata>
|
||||||
|
<policy_published>
|
||||||
|
<domain>example.com</domain>
|
||||||
|
<adkim>r</adkim>
|
||||||
|
<aspf>r</aspf>
|
||||||
|
<p>none</p>
|
||||||
|
<sp>none</sp>
|
||||||
|
<pct>100</pct>
|
||||||
|
<fo>0</fo>
|
||||||
|
</policy_published>
|
||||||
|
<record>
|
||||||
|
<row>
|
||||||
|
<source_ip>100.24.188.149</source_ip>
|
||||||
|
<count>1</count>
|
||||||
|
<policy_evaluated>
|
||||||
|
<disposition>none</disposition>
|
||||||
|
<dkim>fail</dkim>
|
||||||
|
<spf>fail</spf>
|
||||||
|
</policy_evaluated>
|
||||||
|
</row>
|
||||||
|
<identifiers>
|
||||||
|
<envelope_to>hotmail.com</envelope_to>
|
||||||
|
<envelope_from>example.com</envelope_from>
|
||||||
|
<header_from>example.com</header_from>
|
||||||
|
</identifiers>
|
||||||
|
<auth_results>
|
||||||
|
<spf>
|
||||||
|
<domain>example.com</domain>
|
||||||
|
<scope>mfrom</scope>
|
||||||
|
<result>fail</result>
|
||||||
|
</spf>
|
||||||
|
</auth_results>
|
||||||
|
</record>
|
||||||
|
</feedback>
|
||||||
Reference in New Issue
Block a user