From cc3d54ea23e2c668544f32c0a41b15c0578ce4b3 Mon Sep 17 00:00:00 2001 From: "A. Schulze" Date: Wed, 17 Jan 2024 19:04:47 +0100 Subject: [PATCH] s/extenTion/extenSion/ --- README.md | 2 +- dmarc_dsn_processor.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 53da59c..f151f93 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ status messages. Configure Postfix to deliver these messages with the argv=/path/to/dmarc_dsn_processor.py ${queue_id} ${extension} /path/to/data_dir ``` -Enable address extentions that may contain VERP information. +Enable address extensions that may contain VERP information. To prevent Postfix from sending multiple recipients per delivery request, limit parallel deliveries: diff --git a/dmarc_dsn_processor.py b/dmarc_dsn_processor.py index c274e6f..d89938f 100644 --- a/dmarc_dsn_processor.py +++ b/dmarc_dsn_processor.py @@ -5,9 +5,9 @@ This program process dsn messages received for DMARC aggregate reports. -Usage: cat dns_message | $0 queue_id extention [data_dir] +Usage: cat dns_message | $0 queue_id extension [data_dir] - - extention must be present, may be empty + - extension must be present, may be empty - data_dir if missing, ENV[DATA_DIR] is used - data_dir must exist and be writeable for the current uid @@ -133,19 +133,19 @@ def process_googlegroups_dsn(msg): recipients.append(rcpt) return recipients -def process_with_extention(extention: str, mail_data: str): +def process_with_extension(extension: str, mail_data: str): """ - process the email, for a known extention + process the email, for a known extension in this case, only the report domain must be searched """ - logging.debug("DEBUG: process_with_extention") + logging.debug("DEBUG: process_with_extension") - report_rcpt = extention.replace("=", "@") + report_rcpt = extension.replace("=", "@") if not validators.email(report_rcpt): logging.error("ERROR: '%s' is not a valid report_rcpt", report_rcpt) - save_message('no_report_rcpt_in_extention') + save_message('no_report_rcpt_in_extension') sys.exit(0) match = re.search(RE_BODY_REPORT_DOMAIN, mail_data) @@ -165,7 +165,7 @@ def process_with_extention(extention: str, mail_data: str): rcpt = {} rcpt['report_domain'] = report_domain rcpt["action"] = "any_reason" - rcpt["orig_rcpt"] = extention.replace("=", "@") + rcpt["orig_rcpt"] = extension.replace("=", "@") rcpt["date"] = DATE recipients = [] @@ -285,12 +285,12 @@ def save_message(reason: str): # argv[0] = program name # argv[1] = queue_id -# argv[2] = extention +# argv[2] = extension # argv[3] = data_dir, optional, default to $DATA_DIR, default to ./dmarc_dsn_processor # len(argv) == 4 if len(sys.argv) < 3: - logging.error("ERROR: usage: $0 queue_id extention [work_dir]") + logging.error("ERROR: usage: $0 queue_id extension [work_dir]") sys.exit(1) QUEUE_ID = sys.argv[1] @@ -325,8 +325,8 @@ def save_message(reason: str): DATE = today.strftime("%Y%m%d") if EXTENTION != "": - logging.debug("DEBUG: extention='%s'", EXTENTION) - dsn_details = process_with_extention(EXTENTION, MAIL_DATA) + logging.debug("DEBUG: extension='%s'", EXTENTION) + dsn_details = process_with_extension(EXTENTION, MAIL_DATA) else: dsn_details = process_dsn(MAIL_DATA)