From b6054aafce946e5e0dfc3e90353b7ccb2ab8da2a Mon Sep 17 00:00:00 2001 From: Sean Whalen <44679+seanthegeek@users.noreply.github.com> Date: Mon, 9 May 2022 10:01:04 -0400 Subject: [PATCH] Prep for 8.1.0 - Restore compatability with <8.0.0 configuration files (with deprecation warnings) - Move `parsedmarc.__version__` to `parsedmarc.meta.__version__` - Set default `reports_folder` to `Inbox` (rather than `INBOX`) when `msgraph` is configured --- CHANGELOG.md | 7 +++++++ parsedmarc/__init__.py | 2 +- parsedmarc/cli.py | 39 +++++++++++++++++++++++++++++++++++++++ parsedmarc/meta.py | 1 + setup.py | 2 +- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 parsedmarc/meta.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ea57a6b..8744a07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========= +8.1.0 +----- + +- Restore compatability with <8.0.0 configuration files (with deprecation warnings) +- Move `parsedmarc.__version__` to `parsedmarc.meta.__version__` +- Set default `reports_folder` to `Inbox` (rather than `INBOX`) when `msgraph` is configured + 8.0.3 ----- diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index a682b66..72b90a9 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -34,7 +34,7 @@ from parsedmarc.utils import is_outlook_msg, convert_outlook_msg from parsedmarc.utils import parse_email from parsedmarc.utils import timestamp_to_human, human_timestamp_to_datetime -__version__ = "8.0.3" +from parsedmarc.meta import __version__ formatter = logging.Formatter( fmt='%(levelname)8s:%(filename)s:%(lineno)d:%(message)s', diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index beb8e50..5722f57 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -379,6 +379,8 @@ def _main(): if "mailbox" in config.sections(): mailbox_config = config["mailbox"] + if "msgraph" in config.sections(): + opts.mailbox_reports_folder = "Inbox" if "reports_folder" in mailbox_config: opts.mailbox_reports_folder = mailbox_config["reports_folder"] if "archive_folder" in mailbox_config: @@ -430,6 +432,43 @@ def _main(): logger.critical("password setting missing from the " "imap config section") exit(-1) + if "reports_folder" in imap_config: + opts.mailbox_reports_folder = imap_config["reports_folder"] + logger.warning("Use of the reports_folder option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + if "archive_folder" in imap_config: + opts.mailbox_archive_folder = imap_config["archive_folder"] + logger.warning("Use of the archive_folder option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + if "watch" in imap_config: + opts.mailbox_watch = imap_config.getboolean("watch") + logger.warning("Use of the watch option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + if "delete" in imap_config: + logger.warning("Use of the delete option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + if "test" in imap_config: + opts.mailbox_test = imap_config.getboolean("test") + logger.warning("Use of the test option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + if "batch_size" in imap_config: + opts.mailbox_batch_size = imap_config.getint("batch_size") + logger.warning("Use of the batch_size option in the imap " + "configuration section has been deprecated. " + "Use this option in the mailbox configuration " + "section instead.") + else: + opts.mailbox_batch_size = None if "msgraph" in config.sections(): graph_config = config["msgraph"] diff --git a/parsedmarc/meta.py b/parsedmarc/meta.py new file mode 100644 index 0000000..70dab03 --- /dev/null +++ b/parsedmarc/meta.py @@ -0,0 +1 @@ +__version__ = "8.1.0" diff --git a/setup.py b/setup.py index c4ef500..f8ff28d 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup from codecs import open from os import path -__version__ = "8.0.3" +from parsedmarc.meta import __version__ description = "A Python package and CLI for parsing aggregate and " \ "forensic DMARC reports"