Skip to content

Commit 577087b

Browse files
authored
Release v1.7.0 (#89)
- feat: added HarakaMx #89 - feat: add add_line_processor - test: added get_implicit_mx tests #89 - change: get_mx: don't filter implicit MX errors #89 - fix(get_public_ip): set timeout in stun request, fixes #84
1 parent 52aa4e7 commit 577087b

14 files changed

+1534
-1094
lines changed

.release

CHANGELOG.md

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
44

55
### Unreleased
66

7+
### [1.7.0] - 2024-04-29
8+
9+
- feat: added HarakaMx #89
10+
- feat: add add_line_processor, aka line_socket.setup_line_processor
11+
- fix(get_public_ip): set timeout in stun request, fixes #84
12+
- test: added get_implicit_mx tests #89
13+
- change: get_mx: don't filter implicit MX errors #89
14+
715
### [1.6.0] - 2024-04-17
816

917
- feat: normalizeDomain, for punycode/IDN names
18+
<!-- prettier-ignore -->
1019
- feat: get_mx now _also_ returns implicit MX records
1120
- feat: added get_implicit_mx
1221
- feat: added resolve_mx_hosts
@@ -62,88 +71,88 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6271
- chore(ci): populate test matrix with Node.js LTS versions
6372
- chore(ci): limit dependabot updates to production deps
6473

65-
#### [1.3.5] - 2022-05-27
74+
### [1.3.5] - 2022-05-27
6675

6776
- chore(ci): use shared GHA workflows
6877
- style(es6): use dns.promises internally
6978
- dep(async): replace async dependency with Promise.all
7079
- doc(README): use code fences around examples (vs indention)
7180

72-
#### [1.3.4] - 2022-01-05
81+
### [1.3.4] - 2022-01-05
7382

7483
- promisify get_ips_by_host (backwards compatible)
7584

76-
#### [1.3.3] - 2020-01-05
85+
### [1.3.3] - 2020-01-05
7786

7887
- refactored is_local_host function to return a promise instead of using a callback #65
7988

80-
#### [1.3.2] - 2021-12-20
89+
### [1.3.2] - 2021-12-20
8190

8291
- add is_local_host function #63
8392

84-
#### [1.3.1] - 2021-10-13
93+
### [1.3.1] - 2021-10-13
8594

8695
- get_mx: wrap dns.resolveMx in a try haraka/Haraka#2985
8796
- add .release scripts
8897
- add GH workflow, publish release to NPM upon merge to master
8998

90-
#### 1.3.0 - 2021-01-23
99+
### 1.3.0 - 2021-01-23
91100

92101
- Support passing an array to ip_in_list #60
93102

94-
#### 1.2.4 - 2021-01-14
103+
### 1.2.4 - 2021-01-14
95104

96105
- add "any" IP to is_local_ip
97106
- add TEST-NET-[1-3] to is_private_ip
98107

99-
#### 1.2.3 - 2020-12-19
108+
### 1.2.3 - 2020-12-19
100109

101110
- fix: restore the tests wrapping the resolveMX iterable
102111

103-
#### 1.2.2 - 2020-12-15
112+
### 1.2.2 - 2020-12-15
104113

105114
- get_mx: do not include implicit MX
106115

107-
#### [1.2.1] - 2020-11-17
116+
### [1.2.1] - 2020-11-17
108117

109118
- bump ipaddr.js to 2.0.0 #56
110119

111-
#### [1.2.0] - 2020-06-23
120+
### [1.2.0] - 2020-06-23
112121

113122
- added get_mx
114123
- remove deprecated load_tls_ini
115124
- remove deprecated tls_ini_section_with_defaults
116125

117-
#### 1.1.5 - 2020-04-11
126+
### 1.1.5 - 2020-04-11
118127

119128
- ipv6_bogus: handle parsing broken ipv6 addresses #49
120129
- update async to version 3.0.1 #43
121130

122-
#### 1.1.4 - 2019-04-04
131+
### 1.1.4 - 2019-04-04
123132

124133
- stop is_private_ip from checking if the IP is bound to a local network interface
125134

126-
#### 1.1.3 - 2019-03-01
135+
### 1.1.3 - 2019-03-01
127136

128137
- is_local_ip checks local network interfaces too
129138

130-
#### 1.1.2 - 2018-11-03
139+
### 1.1.2 - 2018-11-03
131140

132141
- add is_local_ip
133142

134-
#### 1.1.1 - 2018-07-19
143+
### 1.1.1 - 2018-07-19
135144

136145
- ip_in_list doesn't throw on empty list
137146

138-
#### 1.1.0 - 2018-04-11
147+
### 1.1.0 - 2018-04-11
139148

140149
- add get_primary_host_name haraka/Haraka#2380
141150

142-
#### 1.0.14 - 2018-01-25
151+
### 1.0.14 - 2018-01-25
143152

144153
- restore tls_ini_section_with_defaults function (deprecated since Haraka 2.0.17)
145154

146-
#### 1.0.13 - 2018-01-19
155+
### 1.0.13 - 2018-01-19
147156

148157
- get_public_ip: assign timer before calling connect #29
149158
- avoid race where timeout isn't cleared because stun connect errors immediately
@@ -152,40 +161,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
152161
- eslint updates #25, #27
153162
- improved x509 parser #22
154163

155-
#### 1.0.10 - 2017-07-27
164+
### 1.0.10 - 2017-07-27
156165

157166
- added vs-stun as optional dep (from Haraka) #21
158167

159-
#### 1.0.9 - 2017-06-16
168+
### 1.0.9 - 2017-06-16
160169

161170
- lint fixes for compat with eslint 4 #18
162171

163-
#### 1.0.8 - 2017-03-08
172+
### 1.0.8 - 2017-03-08
164173

165174
- skip loading expired x509 (TLS) certs
166175
- make TLS cert dir configurable
167176
- rename certs -> cert (be consistent with haraka/plugins/tls)
168177
- store cert/key as buffers (was strings)
169178

170-
#### 1.0.7 - 2017-03-08
179+
### 1.0.7 - 2017-03-08
171180

172181
- handle undefined tls.ini section
173182

174-
#### 1.0.6 - 2017-03-04
183+
### 1.0.6 - 2017-03-04
175184

176185
- add tls_ini_section_with_defaults()
177186
- add load_tls_dir()
178187
- add parse_x509_names()
179188

180-
#### 1.0.5 - 2016-11-20
189+
### 1.0.5 - 2016-11-20
181190

182191
- add enableSNI TLS option
183192

184-
#### 1.0.4 - 2016-10-25
193+
### 1.0.4 - 2016-10-25
185194

186195
- initialize TLS opts in (section != main) as booleans
187196

188-
#### 1.0.3 - 2016-10-25
197+
### 1.0.3 - 2016-10-25
189198

190199
- added tls.ini loading
191200

@@ -197,7 +206,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
197206
[1.3.4]: https://github.com/haraka/haraka-net-utils/releases/tag/1.3.4
198207
[1.3.5]: https://github.com/haraka/haraka-net-utils/releases/tag/1.3.5
199208
[1.3.6]: https://github.com/haraka/haraka-net-utils/releases/tag/1.3.6
200-
[1.3.7]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.3.7
209+
[1.3.7]: https://github.com/haraka/haraka-net-utils/releases/tag/1.3.7
201210
[1.4.0]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.4.0
202211
[1.4.1]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.4.1
203212
[1.5.0]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.5.0
@@ -206,3 +215,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
206215
[1.5.3]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.5.3
207216
[1.5.4]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.5.4
208217
[1.6.0]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.6.0
218+
[1.7.0]: https://github.com/haraka/haraka-net-utils/releases/tag/v1.7.0

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This handcrafted artisinal software is brought to you by:
44

5-
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=msimerson">57</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/662371?v=4"><br><a href="https://github.com/baudehlo">baudehlo</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=baudehlo">4</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/918201?v=4"><br><a href="https://github.com/DoobleD">DoobleD</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=DoobleD">2</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/203240?v=4"><br><a href="https://github.com/lnedry">lnedry</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=lnedry">2</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/791835?v=4"><br><a href="https://github.com/Juerd">Juerd</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=Juerd">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/5957709?v=4"><br><a href="https://github.com/olsonpm">olsonpm</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=olsonpm">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/260607?v=4"><br><a href="https://github.com/typingArtist">typingArtist</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=typingArtist">1</a>) |
5+
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=msimerson">58</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/662371?v=4"><br><a href="https://github.com/baudehlo">baudehlo</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=baudehlo">4</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/918201?v=4"><br><a href="https://github.com/DoobleD">DoobleD</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=DoobleD">2</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/203240?v=4"><br><a href="https://github.com/lnedry">lnedry</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=lnedry">2</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/791835?v=4"><br><a href="https://github.com/Juerd">Juerd</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=Juerd">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/5957709?v=4"><br><a href="https://github.com/olsonpm">olsonpm</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=olsonpm">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/260607?v=4"><br><a href="https://github.com/typingArtist">typingArtist</a> (<a href="https://github.com/haraka/haraka-net-utils/commits?author=typingArtist">1</a>) |
66
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
77

88
<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,50 @@ try {
120120
}
121121
```
122122

123+
### HarakaMx
124+
125+
An object class representing a MX. HarakaMx objects may contain the following properties:
126+
127+
```js
128+
{
129+
exchange: '', // required: a FQDN or IP address
130+
path: '', // the file path to a socket
131+
priority: 0, // integer, a MX priority.
132+
port: 25, // integer: an alternate port
133+
bind: '', // an outbound IP address to bind to
134+
bind_helo: '', // an outbound helo hostname
135+
using_lmtp: false, // boolean, specify LMTP delivery
136+
auth_user: '', // an AUTH username (required if AUTH is desired)
137+
auth_pass: '', // an AUTH password (required if AUTH is desired)
138+
auth_type: '', // an AUTH type that should be used with the MX.
139+
from_dns: '', // the DNS name from which the MX was queried
140+
}
141+
```
142+
143+
Create a HarakaMx object in The Usual Way:
144+
145+
```js
146+
const nu = require('haraka-net-utils')
147+
const myMx = new nu.HarakaMx(parameter)
148+
```
149+
150+
The parameter can be one of:
151+
152+
- A string in any of the following formats:
153+
- hostname
154+
- hostname:port
155+
- IPv4
156+
- IPv4:port
157+
- [IPv6]
158+
- [IPv6]: port
159+
- A [URL](https://nodejs.org/docs/latest-v20.x/api/url.html) string
160+
- smtp://mail.example.com:25
161+
- lmtp://int-mail.example.com:24
162+
- smtp://user:pass@host.example.com:587
163+
- An object, containing at least an exchange, and any of the other properties listed at the top of this section.
164+
165+
An optional second parameter is an alias for from_dns.
166+
123167
[ci-img]: https://github.com/haraka/haraka-net-utils/actions/workflows/ci.yml/badge.svg
124168
[ci-url]: https://github.com/haraka/haraka-net-utils/actions/workflows/ci.yml
125169
[cov-img]: https://codecov.io/github/haraka/haraka-net-utils/coverage.svg

0 commit comments

Comments
 (0)