diff --git a/_modules/index.html b/_modules/index.html index 3401a389..d9e5908d 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -8,7 +8,7 @@ -
| + |
I
|
+ |
| + |
pasedmarc is a Python module and CLI utility for parsing aggregate DMARC reports.
pasedmarc is a Python module and CLI utility for parsing DMARC reports.
usage: parsedmarc.py [-h] [-f FORMAT] [-o OUTPUT]
- [-n NAMESERVER [NAMESERVER ...]] [-t TIMEOUT] [-v]
- file_path [file_path ...]
+usage: parsedmarc [-h] [-o OUTPUT] [-n NAMESERVERS [NAMESERVERS ...]]
+ [-t TIMEOUT] [-H HOST] [-U USERNAME] [-p PASSWORD]
+ [-a ARCHIVE_FOLDER] [-d] [-i] [-T] [-v]
+ [file_path [file_path ...]]
-Parses aggregate DMARC reports
+Parses DMARC reports
positional arguments:
file_path one or more paths of aggregate report files
@@ -196,28 +201,38 @@
optional arguments:
-h, --help show this help message and exit
- -f FORMAT, --format FORMAT
- specify JSON or CSV output format
-o OUTPUT, --output OUTPUT
- output to a file path rather than printing to the
- screen
- -n NAMESERVER [NAMESERVER ...], --nameserver NAMESERVER [NAMESERVER ...]
+ Write output files to the given directory
+ -n NAMESERVERS [NAMESERVERS ...], --nameservers NAMESERVERS [NAMESERVERS ...]
nameservers to query
-t TIMEOUT, --timeout TIMEOUT
number of seconds to wait for an answer from DNS
(default 6.0)
+ -H HOST, --host HOST IMAP hostname or IP address
+ -U USERNAME, --username USERNAME
+ IMAP username
+ -p PASSWORD, --password PASSWORD
+ IMAP password
+ -a ARCHIVE_FOLDER, --archive-folder ARCHIVE_FOLDER
+ Specifies the IMAP folder to move messages to after
+ processing them (default: Archive)
+ -d, --delete Delete the reports after processing them
+ -i, --idle Use an IMAP IDLE connection to process reports as they
+ arrive in the inbox
+ -T, --test Do not move or delete IMAP messages
-v, --version show program's version number and exit
Here are the results from parsing the example report from the dmarc.org wiki. It’s actually an older draft of the the 1.0 report schema standardized in RFC 7480 Appendix C. This draft schema is still in wide use.
-parsedmarc produces consistent, normalized output, regardless of the report schema.
parsedmarc produces consistent, normalized output, regardless of the report
+schema.
{
@@ -290,14 +305,10 @@ This draft schema is still in wide use.
Forensic DMARC reports are emails with an attached email sample that failed a -DMARC check. You can parse them with any email message parser, such as -mail-parser.
-Very few recipients send forensic reports, and even those who do will often -provide only the message headers, and not the message’s content, for privacy -reasons.
+I don’t have a sample I can share for privacy reasons. If you have a sample +forensic report that you can share publicly, please contact me!
$ sudo apt-get install python3-pip
Python 3 installers for Windows and macOS can be found at https://www.python.org/downloads/
-To install or upgrade to the latest stable release of parsedmarc on macOS or Linux, run
Python 3 installers for Windows and macOS can be found at +https://www.python.org/downloads/
+To install or upgrade to the latest stable release of parsedmarc on
+macOS or Linux, run
$ sudo -H pip3 install -U checkdmarc
Note
On Windows, pip3 is pip, even with Python 3. So on Windows, simply
-substitute pip as an administrator in place of sudo pip3, in the above commands.
pip as an administrator in place of sudo pip3, in the
+above commands.
+If you would like to be able to parse emails saved from Microsoft Outlook
+(i.e. OLE .msg files), install msgconvert:
On Debian or Ubuntu systems, run:
+$ sudo apt-get install libemail-outlook-message-perl
+A Python module and CLI for parsing aggregate DMARC reports
+A Python module and CLI for parsing DMARC reports
+ +parsedmarc.InvalidAggregateReport[source]¶Raised when an invalid DMARC aggregate report is encountered
parsedmarc.InvalidDMARCReport[source]¶Raised when an invalid DMARC report is encountered
+parsedmarc.InvalidForensicReport[source]¶Raised when an invalid DMARC forensic report is encountered
+parsedmarc.extract_xml(_input)[source]¶parsedmarc.extract_xml(input_)[source]¶
Extracts xml from a zip or gzip file at the given path, file-like object, or bytes.
| Parameters: | _input – A path to a file, a file like object, or bytes | +
|---|---|
| Parameters: | input – A path to a file, a file like object, or bytes |
| Returns: | The extracted XML |
parsedmarc.get_dmarc_reports_from_inbox(host, username, password, archive_folder='Archive', delete=False, test=False, nameservers=None, dns_timeout=6.0)[source]¶Fetches and parses DMARC reports from sn inbox
+| Parameters: |
|
+
|---|---|
| Returns: | Lists of |
+
| Return type: | OrderedDict + |
+
parsedmarc.human_timestamp_to_datetime(human_timestamp)[source]¶parsedmarc.parse_forensic_report(feedback_report, sample, sample_headers_only, nameservers=None, timeout=6.0)[source]¶Converts a DMARC forensic report and sample to a OrderedDict
| Parameters: |
|
+
|---|---|
| Returns: | An parsed report and sample + |
+
| Return type: | OrderedDict + |
+
parsedmarc.parse_report_email(input_, nameservers=None, timeout=6.0)[source]¶Parses a DMARC report from an email
+| Parameters: |
|
+
|---|---|
| Returns: |
|
+
| Return type: | OrderedDict + |
+
parsedmarc.parse_report_file(input_, nameservers=None, timeout=6.0)[source]¶Parses a DMARC aggregate or forensic file at the given path, a +file-like object. or bytes
+| Parameters: |
|
+
|---|---|
| Returns: | The parsed DMARC report + |
+
| Return type: | OrderedDict + |
+
parsedmarc.save_output(results, output_directory='output')[source]¶Save report data in the given directory
+| Parameters: |
|
+
|---|
parsedmarc.watch_inbox(host, username, password, callback, archive_folder='Archive', delete=False, test=False, wait=30, nameservers=None, dns_timeout=6.0)[source]¶Use an IDLE IMAP connection to parse incoming emails, and pass the results +to a callback function
+| Parameters: |
|
+
|---|