Skip to content

Commit 972a260

Browse files
dkoerichbirdjuliebinkkelley1
authored
TASK-10736: Documentation of new features and changelog of Momentum 5.1 (#800)
Signed-off-by: Doug Koerich <[email protected]> Co-authored-by: Julie Zhao <[email protected]> Co-authored-by: Kris Kelley <[email protected]>
1 parent 2e2593f commit 972a260

File tree

17 files changed

+320
-48
lines changed

17 files changed

+320
-48
lines changed

content/momentum/4/eol-policy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Momentum version 5 became GA on March 1, 2025. Therefore:
6363
| Momentum 4.6.0 | 2023/10/20 | 2024/12/19 | 2024/12/31³ |
6464
| Momentum 4.7.0 | 2023/12/19 | 2025/10/17 | 2027/3/1 |
6565
| Momentum 4.8.0 | 2024/10/17 | 2026/3/1 | 2027/3/1 |
66-
| **Momentum 5.0.0** | 2025/3/1 | TBD | TBD |
66+
| Momentum 5.0.0 | 2025/3/1 | 2026/7/1 | TBD |
67+
| **Momentum 5.1.0** | 2025/7/1 | TBD | TBD |
6768

6869
> ¹ Momentum 4.4.x was superseded by 4.6, which was the last version supporting CentOS 7.
6970
>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
lastUpdated: "05/10/2025"
3+
title: "smtp_tls_reporting"
4+
description: "hook invoked after every TLS events for reporting purpose rfc8460 TLSRPT"
5+
---
6+
7+
<a name="hooks.core.smtp_tls_reporting"></a>
8+
## Name
9+
10+
smtp_tls_reporting - This hook is added in 5.1 and allows you inspect a SMTP TLS reporting data
11+
point in JSON format.
12+
13+
## Synopsis
14+
15+
`#include "hooks/core/smtp_tls_reporting.h"`
16+
17+
`int core_smtp_tls_reporting(void closure, struct json_object *json)`
18+
19+
20+
## Description
21+
22+
This hook is called upon:
23+
- any TLSRPT (rfc8460) defined failures, before a TLS connection is attempted,
24+
normally during TLS policy (including MTA-STS, TLSA/DANE) fetching stage.
25+
- TLS negotiation failures or successes during outbound delivery when MTA-STS or TLSA/DANE is enabled.
26+
**Currently, only enabled on domains with successfully fetched MTA-STS policies or DANE TLSA records **.
27+
28+
The JSON fields and values are defined in `tlsrpt.h`, with most of the field names the same as
29+
defined in the RFC: https://datatracker.ietf.org/doc/html/rfc8460.
30+
31+
The following JSON fields are not defined in the RFC:
32+
* `epoch` - epoch time of when the hook is invoked
33+
* `type` - whether the data is for a successful TLS connection or a failure.
34+
`0` - failure; `1` - success
35+
36+
**An example JSON for a success**:
37+
38+
```
39+
{
40+
"epoch": 1746712864,
41+
"type": 1,
42+
"policy": {
43+
"policy-type": "sts",
44+
"policy-domain": "test.bird.com",
45+
"policy-string": [
46+
"version: STSv1",
47+
"mode: enforce",
48+
"mx: mx.bird.com",
49+
"mx: server.ectest.OMNITI.com",
50+
"max_age: 604800"
51+
]
52+
},
53+
"sending-mta-ip": "127.0.0.1",
54+
"receiving-mx-hostname": "server.ectest.OMNITI.com",
55+
"receiving-ip": "127.0.0.1"
56+
}
57+
```
58+
59+
**An example JSON for a failure**:
60+
61+
```
62+
{
63+
"epoch": 1746629177,
64+
"type": 0,
65+
"policy": {
66+
"policy-type": "sts",
67+
"policy-domain": "mismatch.cert.com",
68+
"policy-string": [
69+
"version: STSv1",
70+
"mode: enforce",
71+
"mx: test.bird.com",
72+
"max_age: 86400"
73+
]
74+
},
75+
"result-type": "certificate-host-mismatch",
76+
"failure-reason-code": "4.7.5 [internal] SSL certificate subject does not match host",
77+
"sending-mta-ip": "127.0.0.1",
78+
"receiving-mx-hostname": "test.BIRD.com",
79+
"receiving-ip": "127.0.0.1"
80+
}
81+
```
82+
83+
84+
**Return Values**
85+
86+
This hook returns `int`, but for now the return value has no significance.
87+
88+
89+
**Threading**
90+
91+
This hook could be called in any thread. Please avoid doing time consuming tasks in the hook's
92+
implementation.
93+
94+
95+
### Example: a Lua implementation of the hook to log the JSON into the `paniclog`
96+
97+
```
98+
require("msys.core");
99+
require("json")
100+
101+
local mod = {}
102+
103+
function mod:core_smtp_tls_reporting(js)
104+
print("tls report: ", js) -- log the whole JSON
105+
if js.type == 0 then -- failure
106+
print(string.format("TLSRPT: %s@%s@%s", js.policy["policy-domain"],
107+
js.policy["policy-type"], js["result-type"]))
108+
else -- success
109+
print(string.format("TLSRPT: %s@%s@%s", js.policy["policy-domain"],
110+
js.policy["policy-type"], "OK"))
111+
end
112+
end
113+
114+
msys.registerModule("tlsrpt", mod);
115+
```
116+
117+
**Example of the paniclog output from the above Lua hook**:
118+
```
119+
1746712864:scriptlet: tls report: { "epoch": 1746712864, "type": 1, "policy": { "policy-type": "sts", "policy-domain": "test.bird.com", "policy-string": [ "version: STSv1", "mode: enforce", "mx: mx.bird.com", "mx: server.ectest.OMNITI.com", "max_age: 604800" ] }, "sending-mta-ip": "127.0.0.1", "receiving-mx-hostname": "server.ectest.OMNITI.com", "receiving-ip": "127.0.0.1" }
120+
1746712864:scriptlet: TLSRPT: test.bird.com@sts@OK
121+
1746719856:scriptlet: tls report: { "epoch": 1746719856, "type": 0, "policy": { "policy-type": "sts", "policy-domain": "mismatch.cert.com", "policy-string": [ "version: STSv1", "mode: enforce", "mx: test.bird.com", "max_age: 86400" ] }, "result-type": "certificate-host-mismatch", "failure-reason-code": "4.7.5 [internal] SSL certificate subject does not match host", "sending-mta-ip": "127.0.0.1", "receiving-mx-hostname": "test.BIRD.com", "receiving-ip": "127.0.0.1" }
122+
1746719856:scriptlet: TLSRPT: mismatch.cert.com@sts@certificate-host-mismatch
123+
```

content/momentum/4/hooks/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ description: "This chapter includes hook point and C function reference material
1616
| [ec_httpsrv_register_auth](/momentum/4/apis-ec-httpsrv-register-auth) | Register an HTTP handler for authenticating a URI |
1717
| [ec_httpsrv_request_local_address](/momentum/4/apis-ec-httpsrv-request-local-address) | Returns the local IP address from the current session |
1818
| [ec_httpsrv_request_peer_address](/momentum/4/apis-ec-httpsrv-request-peer-address) | Returns the remote peer address from the current session |
19-
| [inbound_smtp_tls_post_accept](/momentum/4/hooks/inbound-smtp-tls-post-accept) | Modify the message state after the tls handshake in esmtp_tls_accept (available in 4.4.0 or higher) |
19+
| [inbound_smtp_tls_post_accept](/momentum/4/hooks/inbound-smtp-tls-post-accept) | Modify the message state after the tls handshake in esmtp_tls_accept (available in 4.4.0 or higher) |
20+
| [core_smtp_tls_reporting](/momentum/4/hooks/core-smtp-tls-reporting) | Report TLS events for TLSRPT (TLS reporting) |
2021

2122
This chapter includes hook point and C function reference material that is specific to Momentum 4.
2223

content/momentum/4/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
lastUpdated: "09/30/2024"
3-
title: "Momentum 4.x"
3+
title: "Momentum 4.x and later"
44
description: "Message Systems Inc Copyright 2014-2024 Message Systems Inc Confidential Proprietary Abstract This book documents Momentum 4 Document generated on 2024 Sep 30 Table of Contents Preface 1 Typographical Conventions Used in This Document I Introduction to Momentum 1 Components 2 Life of A Message 3 Roles and Behaviors 4 Licensed..."
55
---
66

@@ -14,7 +14,7 @@ Confidential & Proprietary.
1414

1515
**Abstract**
1616

17-
This book documents Momentum 4.
17+
This book documents Momentum 4 and later.
1818

1919
Document generated on: 2024-Sep-30
2020

content/momentum/4/lua/ref-msys-validate-openarc-sign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This function takes the following parameters:
5656

5757
* `header_canon` – header canonicalization setting.
5858

59-
Supported values are `relaxed`, `simple`. Defaults to `relaxed`.
59+
The only supported value is `relaxed`.
6060

6161
* `body_canon` – body canonicalization setting
6262

content/momentum/4/modules/auth-radius.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ The following example demonstrates how to configure Momentum to pass LOGIN crede
1616
```
1717
# Configure the RADIUS client
1818
auth_radius {
19-
NAS-IP-Address = 10.0.0.1 # the IP address of this SMTP server
19+
NAS-IP-Address = fd01:345::1 # the IP address of this SMTP server
2020
server "one" {
2121
host = "radius-1.example.com"
2222
secret = "secret1"
2323
max_tries = "1"
2424
timeout = "30"
2525
}
26-
server "two" {
27-
host = "radius-2.example.com"
26+
server "ipv6wport" {
27+
host = "[2001:fd3::1]:2812"
2828
secret = "secret2"
2929
max_tries = "2"
3030
timeout = "30"
@@ -85,7 +85,7 @@ RADIUS servers can be defined using the dictionary syntax shown above; the dicti
8585

8686
<dd>
8787

88-
The hostname or IP address of the RADIUS server. If a colon is present in the string then the left side of the string will be used as the hostname/IP address and the right hand side will be used as the port number on the server. If left unspecified, the RADIUS standard port number of 1812 will be used.
88+
The hostname or IP address of the RADIUS server. The hostname/IP address can be followed by a colon and the port number on the server. If left unspecified, the RADIUS standard port number of 1812 will be used. An IPv6 address must be enclosed in brackets if a port was added.
8989

9090
</dd>
9191

content/momentum/4/modules/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
lastUpdated: "03/01/2025"
2+
lastUpdated: "05/30/2025"
33
title: "Category File"
44
type: "custom"
55
name: "Modules Reference"
@@ -63,7 +63,7 @@ description: "Table of Contents 71 1 Introduction 71 2 ac auth Authentication Ha
6363
| [openarc](/momentum/4/modules/openarc) | Open Source ARC |
6464
| [opendkim](/momentum/4/modules/opendkim) | Open Source DKIM |
6565
| [outbound_audit](/momentum/4/modules/outbound-audit) | Outbound traffic analytics |
66-
| [outbound_smtp_auth(modules.outbound_smtp_auth.php) |
66+
| [outbound_smtp_auth](/momentum/4/modules/outbound-smtp-auth) | Outbound authentication |
6767
| [persist_io](/momentum/4/modules/persistio) | Persistent IO Wrapper |
6868
| [pipe_io](/momentum/4/modules/pipeio) | Pipe IO Wrapper |
6969
| [pipe_transport](/momentum/4/modules/pipe-transport) | Module |

content/momentum/4/modules/mail-loop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: "The mail loop module provides automatic suppression of potential m
88

99
The mail_loop module provides automatic suppression of potential mail loops with two standard mechanisms:
1010

11-
* Suppression of delivery attempts to any configured IP interfaces on the machine.
11+
* Suppression of delivery attempts to any configured IP interfaces on the machine, including IPv6.
1212

1313
* Suppression of messages with more than a specified number of Received headers.
1414

content/momentum/4/modules/mxip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mxip.example. 86400 IN NS localhost.
6363

6464
The mxip module implements a dns_get_As hook in order to augment the DNS resolution behaviour. If your integration or deployment also implements a dns_get_As hook, then you may not be able to use the mxip module.
6565

66-
The mxip module only supports IPv4 addresses in the hostname field of MX records. IPv6 addresses are explicitly not supported by the mxip module.
66+
The mxip module supports IPv4 (and IPv6 as of Momentum 5.1) addresses in the hostname field of MX records.
6767

6868
The mxip module can be configured as follows:
6969

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,94 @@
11
---
2-
lastUpdated: "03/26/2020"
2+
lastUpdated: "05/30/2025"
33
title: "outbound_smtp_auth"
4-
description: "This module enables users to specify authentication parameters for a given set of messages so that Momentum will authenticate against the peer server when it sends outbound mail It currently supports the AUTH LOGIN and AUTH PLAIN methods of authentication You can specify the parameters in configuration or in lua..."
4+
description: "This module enables users to specify authentication parameters for a given set of messages so that Momentum will authenticate against the peer server when it sends outbound mail It currently supports the AUTH LOGIN, AUTH PLAIN and AUTH XOAUTH2 methods of authentication You can specify the parameters in configuration or in lua..."
55
---
66

7-
<a name="idp22419360"></a>
7+
<a name="modules.outbound_smtp_auth"></a>
88

9-
This module enables users to specify authentication parameters for a given set of messages so that Momentum will authenticate against the peer server when it sends outbound mail. It currently supports the 'AUTH LOGIN' and 'AUTH PLAIN' methods of authentication. You can specify the parameters in configuration or in lua, or use a combination of both.
9+
This module enables users to specify authentication parameters for a given set of messages so that
10+
Momentum will authenticate against the peer server when it sends outbound mail. It currently
11+
supports the `AUTH LOGIN`, `AUTH PLAIN` and `AUTH XOAUTH2` methods of authentication.
12+
You can specify the parameters in configuration or in lua, or use a combination of both.
1013

1114
### Note
1215

1316
This module makes heavy use of message contexts to facilitate authentication. If it is enabled, you risk having extra I/O unless `keep_message_dicts_in_memory` is on.
1417

15-
**Configuration Change. ** This feature is available in Momentum 4.2 and later.
16-
1718
### <a name="modules.outbound_smtp_auth.configuration"></a> Configuration
1819

19-
Configuration variables are listed below. These values can all be changed and overridden by setting context variables with the same name as the options in lua. All variables are valid in the binding group, binding, domain, and global scopes.
20-
21-
<dl class="variablelist">
22-
23-
<dt>outbound_smtp_auth_key</dt>
24-
25-
<dd>
20+
> This module is refactored in Momentum 5.1, but this feature is available in
21+
Momentum 4.2 and later. `AUTH XOAUTH2` support is added in 5.1.
2622

27-
A unique key that can be used in lua to look up authorization details in a database. It enables you to easily trigger custom behavior based on a configuration scope. The default value is `false`.
23+
Configuration variables are listed below. These values can all be changed and overridden by setting
24+
message context variables with the same name as the options in lua.
25+
All variables are valid in the binding group, binding, domain, and global scopes.
2826

29-
</dd>
27+
<dl class="variablelist">
3028

3129
<dt>outbound_smtp_auth_pass</dt>
3230

3331
<dd>
3432

35-
The password that will be passed to the remote server. The default value is `false`.
33+
The password or auth token (e.g. for `AUTH XOAUTH2`) that will be passed to the remote server.
34+
It has no default value.
3635

3736
### Note
3837

39-
Setting the password in configuration will leave it as plaintext. To set the password more securely, dynamically retrieve it from a data store in lua and set it in the context variable that corresponds to this option.
38+
Setting the password in configuration will leave it as plaintext.
39+
To set the password more securely, it's recommended to dynamically retrieve it from a data store
40+
in lua and set it in the context variable that corresponds to this option.
4041

4142
</dd>
4243

4344
<dt>outbound_smtp_auth_type</dt>
4445

4546
<dd>
4647

47-
Determines what authentication protocol should be used. The only supported values are 'PLAIN' and 'LOGIN'. The default value is `false`.
48+
Determines what authentication protocol should be used. The only supported values are `PLAIN`,
49+
`LOGIN` and `XOAUTH2`. It has no default value.
4850

4951
</dd>
5052

5153
<dt>outbound_smtp_auth_user</dt>
5254

5355
<dd>
5456

55-
The username that will be passed to the remote server. The default value is `false`.
57+
The username that will be passed to the remote server. It has no default value.
5658

5759
</dd>
5860

5961
</dl>
6062

6163
### <a name="modules.outbound_smtp_auth.usage"></a> Usage
6264

65+
A hook `outbound_smtp_auth_config(msg)` is added by this module to allow per message auth settings.
66+
The settings in `ec_message` context will override the configuration values.
67+
This hook is called in delivery/scheduler thread before sending SMTP `AUTH` command.
68+
Please avoid blocking or lengthy operations when implementing this hook.
69+
6370
Basic examples of usage are provided below.
6471

65-
The following example shows how you can extend the new hook and set the username and password in lua.
72+
The following example shows how you can extend the new hook and set the username and password in lua
73+
for each message.
6674

67-
<a name="modules.outbound_smtp_auth.example.set_username_pw"></a>
75+
<a name="modules.outbound_smtp_auth.example.set_username_pw"></a>
6876

6977

7078
```
71-
function mod:outbound_smtp_auth_config(msg, ac, vctx)
72-
print('NOTICE: outbound_smtp_auth_config Lua hook called');
73-
print('NOTICE: msg:['.. tostring(msg) ..']')
74-
msg:context_set(VCTX_MESS, 'outbound_smtp_auth_user', 'foo')
75-
msg:context_set(VCTX_MESS, 'outbound_smtp_auth_pass', 'bar')
79+
function mod:outbound_smtp_auth_config(msg)
80+
--print('NOTICE: outbound_smtp_auth_config Lua hook called');
81+
msg:context_set(VCTX_MESS, 'outbound_smtp_auth_type', 'XOAUTH2')
82+
-- credential taken from example here:
83+
-- https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth
84+
msg:context_set(VCTX_MESS, 'outbound_smtp_auth_user', '[email protected]')
85+
msg:context_set(VCTX_MESS, 'outbound_smtp_auth_pass', 'EwBAAl3BAAUFFpUAo7J3Ve0bjLBWZWCclRC3EoAA')
7686
end
7787
```
7888

7989
The following example shows how to use the new configuration variables to set distinct authorization parameters for two different domains.
8090

81-
<a name="modules.outbound_smtp_auth.example.set_auth_parms"></a>
91+
<a name="modules.outbound_smtp_auth.example.set_auth_parms"></a>
8292

8393

8494
```
@@ -90,13 +100,17 @@ Domain "messagesystems.com" {
90100
Outbound_SMTP_AUTH_Type = "LOGIN"
91101
Outbound_SMTP_AUTH_User = "msys"
92102
Outbound_SMTP_AUTH_Pass = "msys"
93-
Outbound_SMTP_AUTH_Key = "somestring"
94103
}
95104
96105
Domain "sparkpost.com" {
97106
Outbound_SMTP_AUTH_Type = "PLAIN"
98107
Outbound_SMTP_AUTH_user = "sparkpost"
99108
Outbound_SMTP_AUTH_pass = "sparkpost"
100-
Outbound_SMTP_AUTH_Key = "someotherstring"
101109
}
102-
```
110+
111+
Domain "bird.com" {
112+
Outbound_SMTP_AUTH_Type = "XOAUTH2"
113+
Outbound_SMTP_AUTH_user = "[email protected]"
114+
Outbound_SMTP_AUTH_pass = "EwBAAl3BAAUFFpUAo7J3Ve0bjLBWZWCclRC3EoAA"
115+
}
116+
```

0 commit comments

Comments
 (0)