Skip to content

Commit a71ac8d

Browse files
authored
doc(README): add ini code fences, improve docs (#20)
* dep(net-utils): bumped 1.5.0 -> 1.5.3 * update changes
1 parent f587890 commit a71ac8d

File tree

5 files changed

+104
-88
lines changed

5 files changed

+104
-88
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,10 @@ jobs:
1414
# uses: haraka/.github/.github/workflows/coverage.yml@master
1515
# secrets: inherit
1616

17-
test:
18-
needs: [ lint, get-lts ]
19-
runs-on: ${{ matrix.os }}
20-
strategy:
21-
matrix:
22-
os: [ ubuntu-latest, windows-latest ]
23-
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
24-
fail-fast: false
25-
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-node@v3
28-
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
29-
with:
30-
node-version: ${{ matrix.node-version }}
31-
- run: npm install
32-
- run: npm test
17+
ubuntu:
18+
needs: [ lint ]
19+
uses: haraka/.github/.github/workflows/ubuntu.yml@master
3320

34-
get-lts:
35-
runs-on: ubuntu-latest
36-
steps:
37-
- id: get
38-
uses: msimerson/node-lts-versions@v1
39-
outputs:
40-
active: ${{ steps.get.outputs.active }}
41-
lts: ${{ steps.get.outputs.lts }}
21+
windows:
22+
needs: [ lint ]
23+
uses: haraka/.github/.github/workflows/windows.yml@master

.release

Changes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
### Unreleased
33

44

5+
### [1.2.4] - 2024-02-07
6+
7+
- doc(README): add ini code fences, improve docs
8+
- dep(net-utils): bumped 1.5.0 -> 1.5.3
9+
10+
511
### [1.2.3] - 2023-07-14
612

713
- fix: Handle DNS TXT array result (#15)
@@ -65,3 +71,4 @@
6571
[1.2.1]: https://github.com/haraka/haraka-plugin-spf/releases/tag/1.2.1
6672
[1.3.0]: https://github.com/haraka/haraka-plugin-spf/releases/tag/1.3.0
6773
[1.2.3]: https://github.com/haraka/haraka-plugin-spf/releases/tag/1.2.3
74+
[1.2.4]: https://github.com/haraka/haraka-plugin-spf/releases/tag/1.2.4

README.md

Lines changed: 82 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ To make it reject mail then you will need to enable the relevant options below.
1313
of SPF but you will need to whitelist any hosts forwarding mail from another
1414
domain whilst preserving the original return-path.
1515

16-
Configuration
16+
## Configuration
17+
1718
-------------
1819

1920
This plugin uses spf.ini for configuration and the following options are
2021
available:
2122

22-
[relay]
23-
context=sender (default: sender)
23+
24+
```ini
25+
[relay]
26+
context=sender (default: sender)
27+
```
2428

2529
On connections with relaying privileges (MSA or mail relay), it is often
2630
desirable to evaluate SPF from the context of Haraka's public IP(s), in the
@@ -35,24 +39,28 @@ denying mail from senders whose SPF fails the checks.
3539

3640
Additional settings allow you to control the small things (defaults are shown):
3741

38-
; The lookup timeout, in seconds. Better set it to something much lower than this.
39-
lookup_timeout = 29
42+
```ini
43+
; The lookup timeout, in seconds. Better set it to something much lower than this.
44+
lookup_timeout = 29
4045

41-
; bypass hosts that match these conditions
42-
[skip]
43-
; hosts that relay through us
44-
relaying = false
45-
; hosts that are SMTP AUTH'ed
46-
auth = false
46+
; bypass hosts that match these conditions
47+
[skip]
48+
; hosts that relay through us
49+
relaying = false
50+
; hosts that are SMTP AUTH'ed
51+
auth = false
52+
```
4753

4854
There's a special setting that would allow the plugin to emit a funny explanation text on SPF DENY, essentially meant to be visible to end-users that will receive the bounce. The text is `http://www.openspf.org/Why?s=${scope}&id=${sender_id}&ip=${connection.remote.ip}` and is enabled by:
4955

50-
[deny]
51-
openspf_text = true
52-
53-
; in case you DENY on failing SPF on hosts that are relaying (but why?)
54-
[deny_relay]
55-
openspf_text = true
56+
```ini
57+
[deny]
58+
openspf_text = true
59+
60+
; in case you DENY on failing SPF on hosts that are relaying (but why?)
61+
[deny_relay]
62+
openspf_text = true
63+
```
5664

5765
### Things to Know
5866

@@ -78,40 +86,59 @@ There's a special setting that would allow the plugin to emit a funny explanatio
7886

7987
* Heed well the implications of SPF, as described in [RFC 4408](http://tools.ietf.org/html/rfc4408#section-9.3)
8088

81-
[defer]
82-
helo_temperror
83-
mfrom_temperror
84-
85-
[deny]
86-
helo_none
87-
helo_softfail
88-
helo_fail
89-
helo_permerror
90-
91-
mfrom_none
92-
mfrom_softfail
93-
mfrom_fail
94-
mfrom_permerror
95-
96-
openspf_text
97-
98-
; SPF settings used when connection.relaying=true
99-
[defer_relay]
100-
helo_temperror
101-
mfrom_temperror
102-
103-
[deny_relay]
104-
helo_none
105-
helo_softfail
106-
helo_fail
107-
helo_permerror
108-
109-
mfrom_none
110-
mfrom_softfail
111-
mfrom_fail
112-
mfrom_permerror
113-
114-
openspf_text
89+
### spf.ini default settings
90+
91+
```ini
92+
lookup_timeout = 29
93+
94+
95+
[relay]
96+
context=sender
97+
98+
99+
[skip]
100+
relaying=false
101+
auth=false
102+
103+
104+
[defer]
105+
helo_temperror=false
106+
mfrom_temperror=false
107+
108+
109+
[deny]
110+
helo_none=false
111+
helo_softfail=false
112+
helo_fail=false
113+
helo_permerror=false
114+
115+
mfrom_none=false
116+
mfrom_softfail=false
117+
mfrom_fail=false
118+
mfrom_permerror=false
119+
120+
openspf_text=false
121+
122+
123+
; SPF settings used when connection.relaying=true
124+
[defer_relay]
125+
helo_temperror=false
126+
mfrom_temperror=false
127+
128+
129+
[deny_relay]
130+
helo_none=false
131+
helo_softfail=false
132+
helo_fail=false
133+
helo_permerror=false
134+
135+
mfrom_none=false
136+
mfrom_softfail=false
137+
mfrom_fail=false
138+
mfrom_permerror=false
139+
140+
openspf_text=false
141+
```
115142

116143

117144
Testing
@@ -121,17 +148,17 @@ This plugin also provides a command-line test tool that can be used to debug SPF
121148

122149
To check the SPF record for a domain:
123150

124-
````
151+
```sh
125152
# spf --ip 1.2.3.4 --domain fsl.com
126153
ip=1.2.3.4 helo="" domain="fsl.com" result=Fail
127-
````
154+
```
128155

129156
To check the SPF record for a HELO/EHLO name:
130157

131-
````
158+
```sh
132159
# spf --ip 1.2.3.4 --helo foo.bar.com
133160
ip=1.2.3.4 helo="foo.bar.com" domain="" result=None
134-
````
161+
```
135162

136163
You can add `--debug` to the option arguments to see a full trace of the SPF processing.
137164

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "haraka-plugin-spf",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Sender Policy Framework (SPF) plugin for Haraka",
55
"main": "index.js",
66
"scripts": {
@@ -24,19 +24,19 @@
2424
"url": "https://github.com/haraka/haraka-plugin-spf/issues"
2525
},
2626
"homepage": "https://github.com/haraka/haraka-plugin-spf#readme",
27-
"devDependencies": {
28-
"eslint": "^8.42.0",
29-
"eslint-plugin-haraka": "*",
30-
"haraka-test-fixtures": "^1.3.0",
31-
"mocha": "^9.2.2"
32-
},
3327
"bin": {
3428
"spf": "./bin/spf"
3529
},
3630
"dependencies": {
3731
"haraka-dsn": "^1.0.4",
38-
"haraka-net-utils": "^1.5.0",
32+
"haraka-net-utils": "^1.5.3",
3933
"ipaddr.js": "^2.1.0",
4034
"nopt": "^7.2.0"
35+
},
36+
"devDependencies": {
37+
"eslint": "^8.56.0",
38+
"eslint-plugin-haraka": "*",
39+
"haraka-test-fixtures": "^1.3.3",
40+
"mocha": "^10.2.0"
4141
}
4242
}

0 commit comments

Comments
 (0)