/** * A DKIM/SPF auth result inside a DMARC aggregate record. */ interface DmarcAuthResult { domain?: string; result?: string; } /** * One `<record>` row of a DMARC aggregate report. */ interface DmarcRecordRow { /** * The per-mechanism auth results. */ authResults: { dkim: DmarcAuthResult[]; spf: DmarcAuthResult[]; }; /** * Number of messages this row represents. */ count: number; /** * The policy disposition applied (`none` / `quarantine` / `reject`). */ disposition?: string; /** * The DKIM alignment result (`pass` / `fail`). */ dkim?: string; /** * The `From:` header domain. */ headerFrom?: string; /** * The source IP that sent the messages. */ sourceIp?: string; /** * The SPF alignment result (`pass` / `fail`). */ spf?: string; } /** * A parsed DMARC aggregate (RUA) report. */ interface DmarcAggregateReport { /** * Report window start (`date_range.begin`, unix seconds as a string). */ dateRangeBegin?: string; /** * Report window end (`date_range.end`, unix seconds as a string). */ dateRangeEnd?: string; /** * The reporter's contact email. */ email?: string; /** * The reporting organization. */ organizationName?: string; /** * The published policy the report was evaluated against. */ policyPublished?: { adkim?: string; aspf?: string; domain?: string; p?: string; pct?: number; sp?: string; }; /** * The per-source rows. */ records: DmarcRecordRow[]; /** * The unique report id. */ reportId?: string; } /** * Parses a DMARC aggregate (RUA) report XML document into a structured object. * * Reports arrive gzipped/zipped — decompress to the XML string first. `fast-xml-parser` is an optional * peer dependency (`pnpm add fast-xml-parser`), loaded only via this `./deliverability/dmarc-report` * entry point so the rest of the deliverability tooling stays dependency-free. * @param xml The DMARC aggregate report XML. * @returns The parsed report. See {@link DmarcAggregateReport}. * @throws {EmailError} When `fast-xml-parser` is not installed or the XML cannot be parsed. */ declare const parseDmarcReport: (xml: string) => Promise; export { type DmarcAggregateReport, type DmarcAuthResult, type DmarcRecordRow, parseDmarcReport };