Skip to content

Main function improvement #1

@Dzechy

Description

@Dzechy

It would be a lot better and user friendly to replace the main function with the following:

def main():
    file_path = input("Enter the path to the domain list file: ").strip()
    
    try:
        with open(file_path, "r", encoding="utf-8") as file:
            domains = [line.strip() for line in file if line.strip()]
    except FileNotFoundError:
        print(f"Error: File '{file_path}' not found.")
        return
    except Exception as e:
        print(f"Error reading file: {e}")
        return

    results = {}

    for domain in domains:
        dmarc_info = check_dmarc_policy(domain)
        spf_record = check_spf_record(domain)
        log_domain_scan(domain, dmarc_info["policy"], spf_record)  # Adjust logging
        full_dmarc_record = dmarc_info["full_record"] if dmarc_info else None

        results[domain] = {
            "DMARC": dmarc_info["policy"],
            "SPF": spf_record,
            "Full DMARC": full_dmarc_record,
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions