mailauth 6.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +25 -0
- package/README.md +113 -39
- package/bin/mailauth.js +15 -6
- package/cli.md +9 -3
- package/docs/arc.md +126 -43
- package/docs/bimi.md +54 -37
- package/docs/dkim.md +79 -40
- package/docs/dmarc.md +80 -33
- package/docs/mta-sts.md +140 -42
- package/docs/spf.md +69 -4
- package/index.d.ts +508 -43
- package/lib/arc/index.d.ts +10 -8
- package/lib/arc/index.js +505 -124
- package/lib/bimi/index.js +162 -81
- package/lib/commands/report.js +3 -1
- package/lib/commands/seal.js +35 -5
- package/lib/commands/sign.js +8 -1
- package/lib/commands/spf.js +8 -0
- package/lib/dkim/body/relaxed.js +6 -5
- package/lib/dkim/body/simple.js +1 -3
- package/lib/dkim/dkim-signer.js +219 -33
- package/lib/dkim/dkim-verifier.js +577 -231
- package/lib/dkim/header/relaxed.js +6 -43
- package/lib/dkim/header/signature-opts.js +87 -0
- package/lib/dkim/header/simple.js +6 -43
- package/lib/dkim/message-parser.js +18 -4
- package/lib/dkim/sign.d.ts +13 -7
- package/lib/dkim/sign.js +18 -2
- package/lib/dkim/syntax.js +31 -0
- package/lib/dkim/verify.js +1 -0
- package/lib/dmarc/author-domain.js +181 -0
- package/lib/dmarc/get-dmarc-record.js +154 -47
- package/lib/dmarc/index.d.ts +29 -2
- package/lib/dmarc/verify.js +120 -44
- package/lib/mailauth.js +77 -36
- package/lib/mta-sts.d.ts +77 -11
- package/lib/mta-sts.js +497 -182
- package/lib/parse-dkim-headers.js +376 -191
- package/lib/parse-received.js +104 -32
- package/lib/spf/index.d.ts +37 -1
- package/lib/spf/index.js +260 -28
- package/lib/spf/macro.js +50 -13
- package/lib/spf/spf-verify.js +440 -204
- package/lib/spf/syntax.js +366 -0
- package/lib/tools.js +522 -116
- package/package.json +1 -1
package/lib/arc/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Type definitions for mailauth/lib/arc
|
|
2
2
|
|
|
3
|
-
import { MessageInput, ARCData, ARCOptions, ARCResult, ARCSealOptions, ARCChainEntry } from '../../index';
|
|
3
|
+
import { MessageInput, ARCData, ARCOptions, ARCResult, ARCSealOptions, ARCChainEntry, ARCCreateSealData, ARCSealError } from '../../index';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Verifies ARC chain in a message
|
|
@@ -16,26 +16,28 @@ export function arc(data: ARCData, opts?: ARCOptions): Promise<ARCResult>;
|
|
|
16
16
|
*
|
|
17
17
|
* @param input - RFC822 formatted message (stream, buffer, or string)
|
|
18
18
|
* @param seal - ARC sealing options
|
|
19
|
-
* @returns ARC headers to prepend
|
|
19
|
+
* @returns ARC headers to prepend, empty if no set was created (use createSeal() to see why)
|
|
20
20
|
*/
|
|
21
21
|
export function sealMessage(input: MessageInput, seal: ARCSealOptions): Promise<Buffer>;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Gets ARC chain from parsed headers
|
|
24
|
+
* Gets ARC chain from parsed headers and validates its structure. Throws for a chain that is not valid
|
|
25
25
|
*
|
|
26
26
|
* @param headers - Parsed message headers
|
|
27
|
+
* @param opts - `strict` applies the RFC 8617 syntax rules, lenient acceptances are added to `warnings`
|
|
27
28
|
* @returns ARC chain or false if no chain found
|
|
28
29
|
*/
|
|
29
|
-
export function getARChain(headers: any): ARCChainEntry[] | false;
|
|
30
|
+
export function getARChain(headers: any, opts?: { strict?: boolean; warnings?: string[] }): ARCChainEntry[] | false;
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
|
-
* Verifies ARC seal chain
|
|
33
|
+
* Verifies ARC seal chain. Throws if any seal of the chain is not valid, including a chain whose
|
|
34
|
+
* newest seal has cv=fail
|
|
33
35
|
*
|
|
34
36
|
* @param data - ARC chain data
|
|
35
37
|
* @param opts - ARC verification options
|
|
36
|
-
* @returns true if chain is valid
|
|
38
|
+
* @returns true if chain is valid, false if there is no chain
|
|
37
39
|
*/
|
|
38
|
-
export function verifyASChain(data: ARCData, opts: ARCOptions): Promise<boolean>;
|
|
40
|
+
export function verifyASChain(data: ARCData, opts: ARCOptions & { warnings?: string[] }): Promise<boolean>;
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* Creates ARC seal headers
|
|
@@ -44,4 +46,4 @@ export function verifyASChain(data: ARCData, opts: ARCOptions): Promise<boolean>
|
|
|
44
46
|
* @param data - Seal creation data
|
|
45
47
|
* @returns Seal headers, empty if the ARC-Message-Signature could not be signed, and any errors
|
|
46
48
|
*/
|
|
47
|
-
export function createSeal(input: MessageInput | false, data:
|
|
49
|
+
export function createSeal(input: MessageInput | false, data: ARCCreateSealData): Promise<{ headers: string[]; errors: ARCSealError[]; warnings: string[] }>;
|