mailauth 4.13.1 → 4.13.3

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/docs/spf.md CHANGED
@@ -19,67 +19,67 @@ const result = await spf({
19
19
 
20
20
  ## Result Object Fields
21
21
 
22
- | Field | Type | Presence | Description |
23
- |-------|------|----------|-------------|
24
- | `domain` | `string` | Always | The domain extracted from the sender address for SPF lookup |
25
- | `client-ip` | `string` | Always | The client IP address that was checked |
26
- | `helo` | `string` | If provided | The EHLO/HELO hostname from the SMTP session |
27
- | `envelope-from` | `string` | If provided | The MAIL FROM address |
28
- | `status` | `object` | Always | Verification status object (see below) |
29
- | `header` | `string` | Always | Formatted Received-SPF header value |
30
- | `info` | `string` | Always | Formatted Authentication-Results header value |
31
- | `rr` | `string` | Record found | Raw SPF DNS TXT record |
32
- | `lookups` | `object` | Always | DNS lookup statistics (see below) |
22
+ | Field | Type | Presence | Description |
23
+ | --------------- | -------- | ------------ | ----------------------------------------------------------- |
24
+ | `domain` | `string` | Always | The domain extracted from the sender address for SPF lookup |
25
+ | `client-ip` | `string` | Always | The client IP address that was checked |
26
+ | `helo` | `string` | If provided | The EHLO/HELO hostname from the SMTP session |
27
+ | `envelope-from` | `string` | If provided | The MAIL FROM address |
28
+ | `status` | `object` | Always | Verification status object (see below) |
29
+ | `header` | `string` | Always | Formatted Received-SPF header value |
30
+ | `info` | `string` | Always | Formatted Authentication-Results header value |
31
+ | `rr` | `string` | Record found | Raw SPF DNS TXT record |
32
+ | `lookups` | `object` | Always | DNS lookup statistics (see below) |
33
33
 
34
34
  ## status Object
35
35
 
36
- | Field | Type | Description |
37
- |-------|------|-------------|
38
- | `result` | `string` | SPF result code (see below) |
36
+ | Field | Type | Description |
37
+ | --------- | -------- | ---------------------------------------- |
38
+ | `result` | `string` | SPF result code (see below) |
39
39
  | `comment` | `string` | Human-readable explanation of the result |
40
- | `smtp` | `object` | SMTP session identifiers |
40
+ | `smtp` | `object` | SMTP session identifiers |
41
41
 
42
42
  ### status.smtp Object
43
43
 
44
- | Field | Type | Description |
45
- |-------|------|-------------|
46
- | `mailfrom` | `string` | The MAIL FROM address |
47
- | `helo` | `string` | The HELO/EHLO hostname |
44
+ | Field | Type | Description |
45
+ | ---------- | -------- | ---------------------- |
46
+ | `mailfrom` | `string` | The MAIL FROM address |
47
+ | `helo` | `string` | The HELO/EHLO hostname |
48
48
 
49
49
  ## lookups Object
50
50
 
51
- | Field | Type | Description |
52
- |-------|------|-------------|
53
- | `limit` | `number` | Maximum DNS lookups allowed (default: 10) |
54
- | `count` | `number` | Number of DNS lookups performed |
55
- | `void` | `number` | Number of void (empty result) DNS lookups |
51
+ | Field | Type | Description |
52
+ | ------------ | -------- | ----------------------------------------------------- |
53
+ | `limit` | `number` | Maximum DNS lookups allowed (default: 10) |
54
+ | `count` | `number` | Number of DNS lookups performed |
55
+ | `void` | `number` | Number of void (empty result) DNS lookups |
56
56
  | `subqueries` | `object` | Counts of DNS queries by type (e.g., `{A: 2, MX: 1}`) |
57
57
 
58
58
  ## Result Values
59
59
 
60
- | Result | SPF Qualifier | Description |
61
- |--------|---------------|-------------|
62
- | `pass` | `+` | Sender is authorized |
63
- | `fail` | `-` | Sender is explicitly not authorized |
64
- | `softfail` | `~` | Sender is probably not authorized (transitional) |
65
- | `neutral` | `?` | No policy assertion about the sender |
66
- | `none` | - | No SPF record found or invalid domain |
67
- | `permerror` | - | Permanent error (invalid SPF record, too many DNS lookups) |
68
- | `temperror` | - | Temporary error (DNS timeout, server refused) |
60
+ | Result | SPF Qualifier | Description |
61
+ | ----------- | ------------- | ---------------------------------------------------------- |
62
+ | `pass` | `+` | Sender is authorized |
63
+ | `fail` | `-` | Sender is explicitly not authorized |
64
+ | `softfail` | `~` | Sender is probably not authorized (transitional) |
65
+ | `neutral` | `?` | No policy assertion about the sender |
66
+ | `none` | - | No SPF record found or invalid domain |
67
+ | `permerror` | - | Permanent error (invalid SPF record, too many DNS lookups) |
68
+ | `temperror` | - | Temporary error (DNS timeout, server refused) |
69
69
 
70
70
  ## Comment Format
71
71
 
72
72
  The `status.comment` field follows this format based on the result:
73
73
 
74
- | Result | Comment Format |
75
- |--------|----------------|
76
- | `pass` | `"{mta}: domain of {sender} designates {ip} as permitted sender"` |
77
- | `fail` | `"{mta}: domain of {sender} does not designate {ip} as permitted sender"` |
78
- | `softfail` | `"{mta}: domain of transitioning {sender} does not designate {ip} as permitted sender"` |
79
- | `neutral` | `"{mta}: {ip} is neither permitted nor denied by domain of {sender}"` |
80
- | `none` | `"{mta}: {domain} does not designate permitted sender hosts"` |
81
- | `permerror` | `"{mta}: permanent error in processing during lookup of {sender}: {text}"` |
82
- | `temperror` | `"{mta}: error in processing during lookup of {sender}: {text}"` |
74
+ | Result | Comment Format |
75
+ | ----------- | --------------------------------------------------------------------------------------- |
76
+ | `pass` | `"{mta}: domain of {sender} designates {ip} as permitted sender"` |
77
+ | `fail` | `"{mta}: domain of {sender} does not designate {ip} as permitted sender"` |
78
+ | `softfail` | `"{mta}: domain of transitioning {sender} does not designate {ip} as permitted sender"` |
79
+ | `neutral` | `"{mta}: {ip} is neither permitted nor denied by domain of {sender}"` |
80
+ | `none` | `"{mta}: {domain} does not designate permitted sender hosts"` |
81
+ | `permerror` | `"{mta}: permanent error in processing during lookup of {sender}: {text}"` |
82
+ | `temperror` | `"{mta}: error in processing during lookup of {sender}: {text}"` |
83
83
 
84
84
  ## Example Output
85
85
 
@@ -87,27 +87,27 @@ The `status.comment` field follows this format based on the result:
87
87
 
88
88
  ```json
89
89
  {
90
- "domain": "example.com",
91
- "client-ip": "192.0.2.1",
92
- "helo": "mail.example.com",
93
- "envelope-from": "user@example.com",
94
- "status": {
95
- "result": "pass",
96
- "comment": "mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender",
97
- "smtp": {
98
- "mailfrom": "user@example.com",
99
- "helo": "mail.example.com"
90
+ "domain": "example.com",
91
+ "client-ip": "192.0.2.1",
92
+ "helo": "mail.example.com",
93
+ "envelope-from": "user@example.com",
94
+ "status": {
95
+ "result": "pass",
96
+ "comment": "mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender",
97
+ "smtp": {
98
+ "mailfrom": "user@example.com",
99
+ "helo": "mail.example.com"
100
+ }
101
+ },
102
+ "header": "Received-SPF: pass (mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender) client-ip=192.0.2.1;",
103
+ "info": "spf=pass (mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender) smtp.mailfrom=user@example.com smtp.helo=mail.example.com",
104
+ "rr": "v=spf1 ip4:192.0.2.0/24 -all",
105
+ "lookups": {
106
+ "limit": 10,
107
+ "count": 1,
108
+ "void": 0,
109
+ "subqueries": {}
100
110
  }
101
- },
102
- "header": "Received-SPF: pass (mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender) client-ip=192.0.2.1;",
103
- "info": "spf=pass (mx.receiver.com: domain of user@example.com designates 192.0.2.1 as permitted sender) smtp.mailfrom=user@example.com smtp.helo=mail.example.com",
104
- "rr": "v=spf1 ip4:192.0.2.0/24 -all",
105
- "lookups": {
106
- "limit": 10,
107
- "count": 1,
108
- "void": 0,
109
- "subqueries": {}
110
- }
111
111
  }
112
112
  ```
113
113
 
@@ -115,27 +115,27 @@ The `status.comment` field follows this format based on the result:
115
115
 
116
116
  ```json
117
117
  {
118
- "domain": "example.com",
119
- "client-ip": "203.0.113.1",
120
- "helo": "attacker.example.net",
121
- "envelope-from": "user@example.com",
122
- "status": {
123
- "result": "fail",
124
- "comment": "mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender",
125
- "smtp": {
126
- "mailfrom": "user@example.com",
127
- "helo": "attacker.example.net"
118
+ "domain": "example.com",
119
+ "client-ip": "203.0.113.1",
120
+ "helo": "attacker.example.net",
121
+ "envelope-from": "user@example.com",
122
+ "status": {
123
+ "result": "fail",
124
+ "comment": "mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender",
125
+ "smtp": {
126
+ "mailfrom": "user@example.com",
127
+ "helo": "attacker.example.net"
128
+ }
129
+ },
130
+ "header": "Received-SPF: fail (mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender) client-ip=203.0.113.1;",
131
+ "info": "spf=fail (mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender) smtp.mailfrom=user@example.com smtp.helo=attacker.example.net",
132
+ "rr": "v=spf1 ip4:192.0.2.0/24 -all",
133
+ "lookups": {
134
+ "limit": 10,
135
+ "count": 1,
136
+ "void": 0,
137
+ "subqueries": {}
128
138
  }
129
- },
130
- "header": "Received-SPF: fail (mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender) client-ip=203.0.113.1;",
131
- "info": "spf=fail (mx.receiver.com: domain of user@example.com does not designate 203.0.113.1 as permitted sender) smtp.mailfrom=user@example.com smtp.helo=attacker.example.net",
132
- "rr": "v=spf1 ip4:192.0.2.0/24 -all",
133
- "lookups": {
134
- "limit": 10,
135
- "count": 1,
136
- "void": 0,
137
- "subqueries": {}
138
- }
139
139
  }
140
140
  ```
141
141
 
@@ -143,26 +143,26 @@ The `status.comment` field follows this format based on the result:
143
143
 
144
144
  ```json
145
145
  {
146
- "domain": "no-spf.example.com",
147
- "client-ip": "192.0.2.1",
148
- "helo": "mail.no-spf.example.com",
149
- "envelope-from": "user@no-spf.example.com",
150
- "status": {
151
- "result": "none",
152
- "comment": "mx.receiver.com: no-spf.example.com does not designate permitted sender hosts",
153
- "smtp": {
154
- "mailfrom": "user@no-spf.example.com",
155
- "helo": "mail.no-spf.example.com"
146
+ "domain": "no-spf.example.com",
147
+ "client-ip": "192.0.2.1",
148
+ "helo": "mail.no-spf.example.com",
149
+ "envelope-from": "user@no-spf.example.com",
150
+ "status": {
151
+ "result": "none",
152
+ "comment": "mx.receiver.com: no-spf.example.com does not designate permitted sender hosts",
153
+ "smtp": {
154
+ "mailfrom": "user@no-spf.example.com",
155
+ "helo": "mail.no-spf.example.com"
156
+ }
157
+ },
158
+ "header": "Received-SPF: none (mx.receiver.com: no-spf.example.com does not designate permitted sender hosts) client-ip=192.0.2.1;",
159
+ "info": "spf=none (mx.receiver.com: no-spf.example.com does not designate permitted sender hosts) smtp.mailfrom=user@no-spf.example.com smtp.helo=mail.no-spf.example.com",
160
+ "lookups": {
161
+ "limit": 10,
162
+ "count": 1,
163
+ "void": 1,
164
+ "subqueries": {}
156
165
  }
157
- },
158
- "header": "Received-SPF: none (mx.receiver.com: no-spf.example.com does not designate permitted sender hosts) client-ip=192.0.2.1;",
159
- "info": "spf=none (mx.receiver.com: no-spf.example.com does not designate permitted sender hosts) smtp.mailfrom=user@no-spf.example.com smtp.helo=mail.no-spf.example.com",
160
- "lookups": {
161
- "limit": 10,
162
- "count": 1,
163
- "void": 1,
164
- "subqueries": {}
165
- }
166
166
  }
167
167
  ```
168
168
 
@@ -170,27 +170,27 @@ The `status.comment` field follows this format based on the result:
170
170
 
171
171
  ```json
172
172
  {
173
- "domain": "complex.example.com",
174
- "client-ip": "192.0.2.1",
175
- "envelope-from": "user@complex.example.com",
176
- "status": {
177
- "result": "permerror",
178
- "comment": "mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests",
179
- "smtp": {
180
- "mailfrom": "user@complex.example.com"
173
+ "domain": "complex.example.com",
174
+ "client-ip": "192.0.2.1",
175
+ "envelope-from": "user@complex.example.com",
176
+ "status": {
177
+ "result": "permerror",
178
+ "comment": "mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests",
179
+ "smtp": {
180
+ "mailfrom": "user@complex.example.com"
181
+ }
182
+ },
183
+ "header": "Received-SPF: permerror (mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests) client-ip=192.0.2.1;",
184
+ "info": "spf=permerror (mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests) smtp.mailfrom=user@complex.example.com",
185
+ "lookups": {
186
+ "limit": 10,
187
+ "count": 11,
188
+ "void": 0,
189
+ "subqueries": {
190
+ "include": 5,
191
+ "a": 3,
192
+ "mx": 2
193
+ }
181
194
  }
182
- },
183
- "header": "Received-SPF: permerror (mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests) client-ip=192.0.2.1;",
184
- "info": "spf=permerror (mx.receiver.com: permanent error in processing during lookup of user@complex.example.com: Too many DNS requests) smtp.mailfrom=user@complex.example.com",
185
- "lookups": {
186
- "limit": 10,
187
- "count": 11,
188
- "void": 0,
189
- "subqueries": {
190
- "include": 5,
191
- "a": 3,
192
- "mx": 2
193
- }
194
- }
195
195
  }
196
196
  ```
@@ -264,8 +264,8 @@ class RelaxedHash {
264
264
  let chunkPart = chunk.subarray(cursorPos, lineEndPos + 1);
265
265
 
266
266
  if (chunkPart.length) {
267
- this._pushBodyHash(lineNeedsFixing ? this.fixLineBuffer(chunkPart) : chunkPart);
268
- lineNeedsFixing = false;
267
+ // batch contains only complete lines verified as not needing fixing at their LFs
268
+ this._pushBodyHash(chunkPart);
269
269
  }
270
270
 
271
271
  cursorPos = lineEndPos + 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailauth",
3
- "version": "4.13.1",
3
+ "version": "4.13.3",
4
4
  "description": "Email authentication library for Node.js",
5
5
  "main": "lib/mailauth.js",
6
6
  "types": "index.d.ts",
@@ -35,26 +35,26 @@
35
35
  "homepage": "https://github.com/postalsys/mailauth",
36
36
  "devDependencies": {
37
37
  "chai": "4.4.1",
38
- "eslint": "10.0.2",
38
+ "eslint": "10.3.0",
39
39
  "eslint-config-nodemailer": "1.2.0",
40
40
  "eslint-config-prettier": "10.1.8",
41
41
  "js-yaml": "4.1.1",
42
42
  "license-report": "6.8.2",
43
43
  "mbox-reader": "1.2.0",
44
44
  "mocha": "11.7.5",
45
- "prettier": "3.8.1",
45
+ "prettier": "3.8.3",
46
46
  "resedit": "3.0.2"
47
47
  },
48
48
  "dependencies": {
49
49
  "@postalsys/vmc": "1.1.4",
50
- "fast-xml-parser": "5.4.2",
51
- "ipaddr.js": "2.3.0",
52
- "joi": "18.0.2",
53
- "libmime": "5.3.7",
54
- "nodemailer": "8.0.1",
50
+ "fast-xml-parser": "5.7.3",
51
+ "ipaddr.js": "2.4.0",
52
+ "joi": "18.2.1",
53
+ "libmime": "5.3.8",
54
+ "nodemailer": "8.0.7",
55
55
  "punycode.js": "2.3.1",
56
- "tldts": "7.0.24",
57
- "undici": "7.22.0",
56
+ "tldts": "7.0.30",
57
+ "undici": "7.25.0",
58
58
  "yargs": "17.7.2"
59
59
  },
60
60
  "engines": {