diff --git a/content/momentum/4/4-lua-summary-table.md b/content/momentum/4/4-lua-summary-table.md index a427611f..cf5d4137 100644 --- a/content/momentum/4/4-lua-summary-table.md +++ b/content/momentum/4/4-lua-summary-table.md @@ -175,7 +175,7 @@ This section contains tables of Lua functions. Click the function name for detai | [msys.validate.dk.get_responsible_domain](/momentum/4/lua/ref-msys-validate-dk-get-responsible-domain) – This function requires module "dk_validate". "msg" is a mail message. "ctx" is the validation context. It returns the responsible domain for the current message | msg, ctx | msys.validate.dk | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.dk.sign](/momentum/4/lua/ref-msys-validate-dk-sign) – Sign a message using a Domain Key | msg, ctx, options | msys.validate.dk | 4.0 | core_data_validation | | [msys.validate.openarc.sign](/momentum/4/lua/ref-msys-validate-openarc-sign) – Sign a message using OpenARC | msg, options, [ar] | msys.validate.openarc | 5.0 | core_post_final_validation | -| [msys.validate.openarc.verify](/momentum/4/lua/ref-msys-validate-openarc-verify) – Verify ARC sets | m | msys.validate.openarc | 5.0 | data_spool, data_spool_each_rcpt | +| [msys.validate.openarc.verify](/momentum/4/lua/ref-msys-validate-openarc-verify) – Verify ARC sets | msg | msys.validate.openarc | 5.0 | data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs) – Return the number of DKIM signatures | dkim | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig) – Get a signature from a DKIM object | dkim, [num] | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons) – Fetch the canonicalizers used for a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | @@ -188,7 +188,7 @@ This section contains tables of Lua functions. Click the function name for detai | [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector) – Fetch the selector associated with a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg) – Return the signing algorithm as a string | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign) – Sign a message using OpenDKIM | msg, vctx, [options] | msys.validate.opendkim | 4.0 | core_final_validation | -| [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify) – Verify an DKIM signature | m | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | +| [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify) – Verify an DKIM signature | msg | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [sess:request_add_header](/momentum/4/lua/ref-sess-request-add-header) – Set the header of an HTTP session | header, value, replace | msys.httpclnt | 4.0 | http_request_eval | | [sess:request_delete_header](/momentum/4/lua/ref-sess-request-delete-header) – Delete a header from an HTTP session | header | msys.httpclnt | 4.0 | http_request_eval | | [sess:request_finalize](/momentum/4/lua/ref-sess-request-finalize) – Finalize changes to an HTTP request | update | msys.httpclnt | 4.0 | http_request_eval | diff --git a/content/momentum/4/hooks/core-post-final-validation.md b/content/momentum/4/hooks/core-post-final-validation.md new file mode 100644 index 00000000..341271bd --- /dev/null +++ b/content/momentum/4/hooks/core-post-final-validation.md @@ -0,0 +1,92 @@ +--- +lastUpdated: "11/26/2024" +title: "post_final_validation" +description: "hook invoked after the normal final validation" +--- + + +## Name + +post_final_validation — This hook is invoked after the normal +[final_validation](/momentum/3/3-api/hooks-core-final-validation) hook + +## Synopsis + +`#include "hooks/core/final_validation.h"` + +| `int **core_post_final_validation** (` | closure, |   | +|   | msg, |   | +|   | ac, |   | +|   | ctx`)`; |   | + +`void * closure`; +`ec_message * msg`; +`accept_construct * ac`; +`validate_context * ctx`; + + +## Description + +This hook is invoked right after the +[final_validation](/momentum/3/3-api/hooks-core-final-validation) hook is called. Its return value +does not have significance for now. +This hook is added as the absolute last point before writing the message into spool. +It guarantees that operations implemented in this hook will happen after the operations done in +`final_validtion`. +No any message modification expected after this stage. +To avoid undefined race between multiple implementations of the same hook, you shall only have up +to one implementation for this hook. +It's the recommended hook point for ARC signing/sealing. + + +**Parameters** + +The parameters from this hook are the same as the ones for `final_validation` hook. + +
+ +
closure
+ +
+ +A pointer to the closure function. + +
+ +
msg
+ +
+ +A pointer to an ec_message struct. For documentation of this data structure see [“ec_message”](/momentum/3/3-api/structs-ec-message) + +
+ +
ac
+ +
+ +The `accept_construct` struct. For documentation of this data structure see [“accept_construct”](/momentum/3/3-api/structs-accept-construct) + +
+ +
ctx
+ +
+ +The `validate_context` struct. For documentation of this data structure see [“validate_context”](/momentum/3/3-api/structs-validate-context) + +
+ +
+ +**Return Values** + +This hook returns `int`, but for now has no significance, i.e. the return value is not checked in +the caller. + +**Threading** + +This hook will be called in any thread. + + + diff --git a/content/momentum/4/modules/openarc.md b/content/momentum/4/modules/openarc.md index c8a65a11..de595665 100644 --- a/content/momentum/4/modules/openarc.md +++ b/content/momentum/4/modules/openarc.md @@ -36,6 +36,6 @@ The `msys.validate.opendarc.sign` does verification first. You should only invok It's recommended to invoke `msys.validate.opendarc.verify` in `validate_data_spool` or [`validate_data_spool_each_rcpt`](/momentum/3/3-api/hooks-core-validate-data-spool-each-rcpt) hook. `msys.validate.opendarc.sign` shall be invoked in the last validation phase, in -[`post_final_validation`](/momentum/4/hooks/core-post-final-validate) hook. +[`post_final_validation`](/momentum/4/hooks/core-post-final-validation) hook. See API examples for hook usages. diff --git a/content/momentum/4/modules/summary-all-modules.md b/content/momentum/4/modules/summary-all-modules.md index cd19e8d1..71b58707 100644 --- a/content/momentum/4/modules/summary-all-modules.md +++ b/content/momentum/4/modules/summary-all-modules.md @@ -70,7 +70,7 @@ All modules are listed alphabetically with a brief description. Singleton module | [msgc_client](/momentum/4/modules/msgc) (*singleton*) | 4.0 | The client component of MSGC |   |  ✓ |   |   | | [msgc_server](/momentum/4/modules/msgc) (*singleton*) | 4.0 | The server component of MSGC |   |  ✓ |   |   | | [“mxip - IP Addresses In MX Records”](/momentum/4/modules/mxip) | 4.2 | Enable Momentum to deliver to domains with a textual IP address |   |   |   |   | -| [“opendarc – Open Source ARC”](/momentum/4/modules/opendarc) | 5.0 | Validate/sign mail using ARC |   |   |  ✓ |   | +| [“openarc – Open Source ARC”](/momentum/4/modules/openarc) | 5.0 | Validate/sign mail using ARC |   |   |  ✓ |   | | [“opendkim – Open Source DKIM”](/momentum/4/modules/opendkim) | 4.0 | Validate/sign mail using DKIM signatures |   |   |  ✓ |   | | [“outbound_audit – Outbound traffic analytics”](/momentum/4/modules/outbound-audit) | 4.0 | Provides time-series analytics on the behavior of receiving domains |   |  ✓ |   |   | | [“outbound_smtp_auth”](/momentum/4/modules/outbound-smtp-auth) | 4.2 | Enables users to specify authentication parameters for a given set of messages |   |   |   |   |