mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-19 18:35:24 +00:00
Update tests
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ install:
|
||||
|
||||
# commands to run samples
|
||||
script:
|
||||
- "flake8 *.py"
|
||||
- "flake8 *.py parsedmarc/*.py"
|
||||
- "cd docs"
|
||||
- "make html"
|
||||
- "cd .."
|
||||
|
||||
@@ -1385,5 +1385,3 @@ def watch_inbox(host, username, password, callback, reports_folder="INBOX",
|
||||
server.idle_done()
|
||||
logger.info("\nIDLE mode done")
|
||||
server.logout()
|
||||
|
||||
|
||||
|
||||
+6
-4
@@ -3,16 +3,18 @@
|
||||
|
||||
"""A CLI for parsing DMARC reports"""
|
||||
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from glob import glob
|
||||
from time import sleep
|
||||
from collections import OrderedDict
|
||||
import json
|
||||
|
||||
from elasticsearch.exceptions import ElasticsearchException
|
||||
|
||||
from parsedmarc import *
|
||||
from parsedmarc import elastic
|
||||
|
||||
__version__ = "3.0.0"
|
||||
from parsedmarc import logger, IMAPError, get_dmarc_reports_from_inbox, \
|
||||
parse_report_file, elastic, save_output, watch_inbox, email_results, \
|
||||
SMTPError, ParserError, __version__
|
||||
|
||||
|
||||
def _main():
|
||||
|
||||
@@ -160,8 +160,8 @@ class AlreadySaved(RuntimeError):
|
||||
|
||||
def set_hosts(hosts):
|
||||
"""
|
||||
Sets the Elasticsearch hosts to use
|
||||
|
||||
Sets the Elasticsearch hosts to use
|
||||
|
||||
Args:
|
||||
hosts: A single hostname or URL, or list of hostnames or URLs
|
||||
"""
|
||||
@@ -300,7 +300,7 @@ def save_forensic_report_to_elasticsearch(forensic_report):
|
||||
headers["from"],
|
||||
headers["subject"],
|
||||
arrival_date_human
|
||||
))
|
||||
))
|
||||
|
||||
parsed_sample = forensic_report["parsed_sample"]
|
||||
sample = ForensicSampleDoc(
|
||||
|
||||
Reference in New Issue
Block a user