domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
961 stars 209 forks source link

Fixes for kafka integration #522

Closed ChibangLW closed 1 month ago

ChibangLW commented 2 months ago

Some variables were not set correctly.

CmellierLNDS commented 4 weeks ago

I have this error while running kafka configuration : CRITICAL:cli.py:870:forensic_topic setting missing from the splunk_hec config section I think it comes from this snippet at line 867. Maybe this code is there for a reason that i don't know but there is no mention on smtp_tls_topic in the documentation of kafka, can you enlighten me ? Why do you need :

            if "smtp_tls_topic" in kafka_config:
                opts.kafka_username = kafka_config["smtp_tls_topic"]
                opts.kafka_smtp_tls_topic = kafka_config["smtp_tls_topic"]
            else:
                logger.critical("forensic_topic setting missing from the "
                                "splunk_hec config section")
ChibangLW commented 3 weeks ago

The text in the error message is wrong. The setting is used if you also enabled save_smtp_sts in the general section.

If I have time I will add the config option to the documentation and only log the error if save_smtp_sts is enabled (same for save_aggregate and save_forensic).

BTW your snipped is a bit outdated as opts.kafka_username = kafka_config["smtp_tls_topic"] was removed in this PR.