From 3f305eb1d9ddd701d5446600257a9884b75cc8b2 Mon Sep 17 00:00:00 2001 From: Doug Koerich Date: Tue, 11 Aug 2026 10:52:02 -0300 Subject: [PATCH 1/5] Momentum#1494 document msys.validate.opendkim.get_sig_result / get_stat_result New Lua helpers that derive the Authentication-Results verdict for a DKIM signature (pass, or a named failure) and map verification statuses that carry no per-signature verdict (none/permerror/temperror). Also caution on the get_sig_errorstr page: its return for a valid signature is the literal "no signature error", never nil, so it must not be used as a pass/fail test. Co-Authored-By: Claude Fable 5 --- content/momentum/4/4-lua-summary-table.md | 2 + content/momentum/4/lua/index.md | 2 + ...msys-validate-opendkim-get-sig-errorstr.md | 6 ++- ...f-msys-validate-opendkim-get-sig-result.md | 53 +++++++++++++++++++ ...-msys-validate-opendkim-get-stat-result.md | 39 ++++++++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md create mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md diff --git a/content/momentum/4/4-lua-summary-table.md b/content/momentum/4/4-lua-summary-table.md index 366e07deb..f5b437157 100644 --- a/content/momentum/4/4-lua-summary-table.md +++ b/content/momentum/4/4-lua-summary-table.md @@ -185,8 +185,10 @@ This section contains tables of Lua functions. Click the function name for detai | [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) – Determine whether a given header was signed | dkim_sig, header_name | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity) – Fetch the identity associated with a DKIM signature | dkim, dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize) – Fetch the size of the key used to generate a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | +| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) – Derive the Authentication-Results verdict for a DKIM signature | dkim_sig | msys.validate.opendkim | 5.3 | data, data_spool, data_spool_each_rcpt | | [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.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) – Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | stat | msys.validate.opendkim | 5.3 | 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 | 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 | diff --git a/content/momentum/4/lua/index.md b/content/momentum/4/lua/index.md index 342fd1a7f..4507e4356 100644 --- a/content/momentum/4/lua/index.md +++ b/content/momentum/4/lua/index.md @@ -202,8 +202,10 @@ description: "This section details all Lua functions Functions are ordered alpha | [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) | Determine whether a given header was signed | | [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity) | Fetch the identity associated with a DKIM signature | | [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize) | Fetch the size of the key used to generate a signature | +| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) | Derive the Authentication-Results verdict for a DKIM signature | | [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector) | Fetch the selector associated with a DKIM signature | | [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg) | Return the signing algorithm as a string | +| [msys.validate.opendkim.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) | Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | | [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign) | Sign a message using OpenDKIM | | [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify) | Verify a DKIM signature | | [thread.mutex](/momentum/4/lua/ref-thread-mutex) | create a new mutex | diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md index 7790342c7..90bdcdb32 100644 --- a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md @@ -1,5 +1,5 @@ --- -lastUpdated: "03/26/2020" +lastUpdated: "08/11/2026" title: "msys.validate.opendkim.get_sig_errorstr" description: "msys validate opendkim get sig errorstr Fetch the error associated with a DKIM signature msys validate opendkim get sig errorstr dkim sig This function fetches the error associated with a DKIM signature Use msys validate opendkim get num sigs and msys validate opendkim get sig to get a DKIM SIGINFO..." --- @@ -25,6 +25,8 @@ Enable this function with the statement `require('msys.validate.opendkim');`. This function returns the error string associated with the DKIM signature (if it exists) and the DKIM status `DKIM_STAT`. +Do not use this function to decide whether a signature verified: for a valid signature it returns the literal string `"no signature error"`, never nil. To derive a pass/fail verdict, use [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result). + The DKIM status `DKIM_STAT` can be one of the following values: * `DKIM_STAT_OK` – successful completion @@ -60,4 +62,4 @@ The DKIM status `DKIM_STAT` can be one of the following values: ## See Also -[msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) \ No newline at end of file +[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) \ No newline at end of file diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md new file mode 100644 index 000000000..1ff39262d --- /dev/null +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md @@ -0,0 +1,53 @@ +--- +lastUpdated: "08/11/2026" +title: "msys.validate.opendkim.get_sig_result" +description: "msys validate opendkim get sig result Derive the Authentication Results verdict for a DKIM signature msys validate opendkim get sig result dkim sig This function returns pass when the signature verified successfully and fail with the failure reason otherwise Use it instead of testing msys validate opendkim get sig errorstr..." +--- + + +## Name + +msys.validate.opendkim.get_sig_result — Derive the Authentication-Results verdict for a DKIM signature + + +## Synopsis + +`msys.validate.opendkim.get_sig_result(dkim_sig)` + +`dkim_sig: userdata, DKIM_SIGINFO type` +## Description + +This function derives the verdict for one DKIM signature, in the form used by the `dkim` clause of an `Authentication-Results` header. It returns the string `"pass"` when the signature verified successfully — the signature validated cryptographically (`DKIM_SIGFLAG_PASSED`) *and* the computed body hash matched the signature's `bh=` tag — and otherwise a string of the form `"fail ()"` naming the specific failure, for example `"fail (signature verification failed)"` or `"fail (key not found in DNS)"`. + +Use `msys.validate.opendkim.get_num_sigs` and `msys.validate.opendkim.get_sig` to get a DKIM_SIGINFO object to pass to this function. + +Do not decide pass/fail by testing `msys.validate.opendkim.get_sig_errorstr` for nil: for a valid signature that function returns the literal string `"no signature error"`, never nil. This function applies the verification result the way libopendkim intends. + +Use `msys.validate.opendkim.get_stat_result` first to handle verification statuses that carry no per-signature verdict: + +```lua +local opendkim = require("msys.validate.opendkim") + +local dkim, stat = opendkim.verify(msg) +local result = opendkim.get_stat_result(stat) +if result == nil then + local num = opendkim.get_num_sigs(dkim) + for i = 0, num - 1 do + local sig = opendkim.get_sig(dkim, i) + if sig then + local domain = opendkim.get_sig_domain(sig) + result = opendkim.get_sig_result(sig) + -- e.g. build "header.DKIM-Signature=@" .. domain .. "; dkim=" .. result + end + end +end +``` + +This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. + +Enable this function with the statement `require('msys.validate.opendkim');`. + + +## See Also + +[msys.validate.opendkim.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_errorstr](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags) \ No newline at end of file diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md new file mode 100644 index 000000000..4fc7e38ad --- /dev/null +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md @@ -0,0 +1,39 @@ +--- +lastUpdated: "08/11/2026" +title: "msys.validate.opendkim.get_stat_result" +description: "msys validate opendkim get stat result Map a DKIM verification status with no per signature verdict to an Authentication Results result msys validate opendkim get stat result stat This function maps the DKIM STAT returned by msys validate opendkim verify to a result string or returns nil when the per signature results are authoritative..." +--- + + +## Name + +msys.validate.opendkim.get_stat_result — Map a DKIM verification status with no per-signature verdict to an Authentication-Results result + + +## Synopsis + +`msys.validate.opendkim.get_stat_result(stat)` + +`stat: number, DKIM_STAT returned by msys.validate.opendkim.verify` +## Description + +This function maps the overall verification status returned by `msys.validate.opendkim.verify` to a result string for the `dkim` clause of an `Authentication-Results` header, for the statuses that carry no per-signature verdict. It returns: + +* `"none (message not signed)"` – the message carried no DKIM signature (`DKIM_STAT_NOSIG`). + +* `nil` – the per-signature results are authoritative (`DKIM_STAT_OK`, `DKIM_STAT_BADSIG`, `DKIM_STAT_NOKEY`, `DKIM_STAT_CANTVRFY`, `DKIM_STAT_REVOKED`); iterate the signatures and report `msys.validate.opendkim.get_sig_result` for each. + +* `"permerror (signature syntax error)"` – the message could not be evaluated (`DKIM_STAT_SYNTAX`). + +* `"temperror (verification status )"` – any other status, including key-retrieval tempfails (`DKIM_STAT_KEYFAIL`) and internal or resource errors; verification may succeed if retried later. + +See the [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) page for a usage example combining both functions. + +This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. + +Enable this function with the statement `require('msys.validate.opendkim');`. + + +## See Also + +[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig) \ No newline at end of file From 5d1b54737b9d173e1c0ab885cf3b72aa88dca86b Mon Sep 17 00:00:00 2001 From: Doug Koerich Date: Tue, 11 Aug 2026 10:52:21 -0300 Subject: [PATCH 2/5] Momentum#1494 the new opendkim helpers land in 5.4 (5.3 already released) Co-Authored-By: Claude Fable 5 --- content/momentum/4/4-lua-summary-table.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/momentum/4/4-lua-summary-table.md b/content/momentum/4/4-lua-summary-table.md index f5b437157..c5170fabb 100644 --- a/content/momentum/4/4-lua-summary-table.md +++ b/content/momentum/4/4-lua-summary-table.md @@ -185,10 +185,10 @@ This section contains tables of Lua functions. Click the function name for detai | [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) – Determine whether a given header was signed | dkim_sig, header_name | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity) – Fetch the identity associated with a DKIM signature | dkim, dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize) – Fetch the size of the key used to generate a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | -| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) – Derive the Authentication-Results verdict for a DKIM signature | dkim_sig | msys.validate.opendkim | 5.3 | data, data_spool, data_spool_each_rcpt | +| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) – Derive the Authentication-Results verdict for a DKIM signature | dkim_sig | msys.validate.opendkim | 5.4 | data, data_spool, data_spool_each_rcpt | | [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.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) – Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | stat | msys.validate.opendkim | 5.3 | data, data_spool, data_spool_each_rcpt | +| [msys.validate.opendkim.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) – Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | stat | msys.validate.opendkim | 5.4 | 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 | 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 | From 4a17c4eee6623564eebc2e8f6798bdb91f30a86a Mon Sep 17 00:00:00 2001 From: Doug Koerich Date: Tue, 11 Aug 2026 10:52:59 -0300 Subject: [PATCH 3/5] Momentum#1494 bump lastUpdated on the touched index pages Co-Authored-By: Claude Fable 5 --- content/momentum/4/4-lua-summary-table.md | 2 +- content/momentum/4/lua/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/momentum/4/4-lua-summary-table.md b/content/momentum/4/4-lua-summary-table.md index c5170fabb..ccde66175 100644 --- a/content/momentum/4/4-lua-summary-table.md +++ b/content/momentum/4/4-lua-summary-table.md @@ -1,5 +1,5 @@ --- -lastUpdated: "03/01/2025" +lastUpdated: "08/11/2026" title: "Lua Functions Summary" description: "This section contains tables of Lua functions Click the function name for details Table 64 1 Lua functions all Function Description Params Package Version Phases ac esmtp capability add Add a capability to the EHLO response name msys extended ac 4 0 connect ehlo ac esmtp capability remove Removes a..." --- diff --git a/content/momentum/4/lua/index.md b/content/momentum/4/lua/index.md index 4507e4356..fec21b0b0 100644 --- a/content/momentum/4/lua/index.md +++ b/content/momentum/4/lua/index.md @@ -1,5 +1,5 @@ --- -lastUpdated: "03/01/2025" +lastUpdated: "08/11/2026" title: "Category File" type: "custom" name: "Lua Functions Reference" From 2520b482aae413b438d9ea6d42e6bea02774f2f9 Mon Sep 17 00:00:00 2001 From: Doug Koerich Date: Tue, 11 Aug 2026 11:00:20 -0300 Subject: [PATCH 4/5] doc: Minor adjustment in the warning Signed-off-by: Doug Koerich --- .../4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md index 90bdcdb32..77cc9d98c 100644 --- a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md @@ -25,7 +25,7 @@ Enable this function with the statement `require('msys.validate.opendkim');`. This function returns the error string associated with the DKIM signature (if it exists) and the DKIM status `DKIM_STAT`. -Do not use this function to decide whether a signature verified: for a valid signature it returns the literal string `"no signature error"`, never nil. To derive a pass/fail verdict, use [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result). +Be cautious when using this function to decide whether a signature is verified: for a valid signature, it returns the literal string `"no signature error"`, never nil. To derive a pass/fail verdict, better to use [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result). The DKIM status `DKIM_STAT` can be one of the following values: @@ -62,4 +62,4 @@ The DKIM status `DKIM_STAT` can be one of the following values: ## See Also -[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) \ No newline at end of file +[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) From 3e12105dc14a77482ab3991dc15a5d6266aebed7 Mon Sep 17 00:00:00 2001 From: Doug Koerich Date: Tue, 11 Aug 2026 12:03:10 -0300 Subject: [PATCH 5/5] doc: changing function names Signed-off-by: Doug Koerich --- content/momentum/4/4-lua-summary-table.md | 4 +- content/momentum/4/lua/index.md | 4 +- ...ys-validate-opendkim-get-sig-ar-verdict.md | 53 +++++++++++++++++++ ...msys-validate-opendkim-get-sig-errorstr.md | 6 +-- ...f-msys-validate-opendkim-get-sig-result.md | 53 ------------------- ...s-validate-opendkim-get-stat-ar-verdict.md | 39 ++++++++++++++ ...-msys-validate-opendkim-get-stat-result.md | 39 -------------- 7 files changed, 99 insertions(+), 99 deletions(-) create mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict.md delete mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md create mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict.md delete mode 100644 content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md diff --git a/content/momentum/4/4-lua-summary-table.md b/content/momentum/4/4-lua-summary-table.md index ccde66175..b0803e9ae 100644 --- a/content/momentum/4/4-lua-summary-table.md +++ b/content/momentum/4/4-lua-summary-table.md @@ -178,6 +178,7 @@ This section contains tables of Lua functions. Click the function name for detai | [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_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict) – Derive the Authentication-Results verdict for a DKIM signature | dkim_sig | msys.validate.opendkim | 5.4 | 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 | | [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain) – Fetch the signing domain from a DKIM_SIGINFO object | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_errorstr](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr) – Fetch the error associated with a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | @@ -185,10 +186,9 @@ This section contains tables of Lua functions. Click the function name for detai | [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) – Determine whether a given header was signed | dkim_sig, header_name | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity) – Fetch the identity associated with a DKIM signature | dkim, dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | | [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize) – Fetch the size of the key used to generate a DKIM signature | dkim_sig | msys.validate.opendkim | 4.0 | data, data_spool, data_spool_each_rcpt | -| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) – Derive the Authentication-Results verdict for a DKIM signature | dkim_sig | msys.validate.opendkim | 5.4 | data, data_spool, data_spool_each_rcpt | | [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.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) – Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | stat | msys.validate.opendkim | 5.4 | data, data_spool, data_spool_each_rcpt | +| [msys.validate.opendkim.get_stat_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict) – Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | stat | msys.validate.opendkim | 5.4 | 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 | 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 | diff --git a/content/momentum/4/lua/index.md b/content/momentum/4/lua/index.md index fec21b0b0..3bdeeb67f 100644 --- a/content/momentum/4/lua/index.md +++ b/content/momentum/4/lua/index.md @@ -195,6 +195,7 @@ description: "This section details all Lua functions Functions are ordered alpha | [msys.validate.openarc.verify](/momentum/4/lua/ref-msys-validate-openarc-verify) | Verify ARC sets | | [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs) | Return the number of DKIM signatures | | [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig) | Get a signature from a DKIM object | +| [msys.validate.opendkim.get_sig_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict) | Derive the Authentication-Results verdict for a DKIM signature | | [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons) | Fetch the canonicalizers used for a signature | | [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain) | Fetch the signing domain from a DKIM_SIGINFO object | | [msys.validate.opendkim.get_sig_errorstr](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr) | Fetch the error associated with a DKIM signature | @@ -202,10 +203,9 @@ description: "This section details all Lua functions Functions are ordered alpha | [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) | Determine whether a given header was signed | | [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity) | Fetch the identity associated with a DKIM signature | | [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize) | Fetch the size of the key used to generate a signature | -| [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) | Derive the Authentication-Results verdict for a DKIM signature | | [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector) | Fetch the selector associated with a DKIM signature | | [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg) | Return the signing algorithm as a string | -| [msys.validate.opendkim.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result) | Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | +| [msys.validate.opendkim.get_stat_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict) | Map a DKIM verification status with no per-signature verdict to an Authentication-Results result | | [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign) | Sign a message using OpenDKIM | | [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify) | Verify a DKIM signature | | [thread.mutex](/momentum/4/lua/ref-thread-mutex) | create a new mutex | diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict.md new file mode 100644 index 000000000..86d2ba71a --- /dev/null +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict.md @@ -0,0 +1,53 @@ +--- +lastUpdated: "08/11/2026" +title: "msys.validate.opendkim.get_sig_ar_verdict" +description: "msys validate opendkim get sig ar verdict Derive the Authentication Results verdict for a DKIM signature msys validate opendkim get sig ar verdict dkim sig This function returns pass when the signature verified successfully and fail with the failure reason otherwise Use it instead of testing msys validate opendkim get sig errorstr..." +--- + + +## Name + +msys.validate.opendkim.get_sig_ar_verdict — Derive the Authentication-Results verdict for a DKIM signature + + +## Synopsis + +`msys.validate.opendkim.get_sig_ar_verdict(dkim_sig)` + +`dkim_sig: userdata, DKIM_SIGINFO type` +## Description + +This function derives the verdict for one DKIM signature, in the form used by the `dkim` clause of an `Authentication-Results` header. It returns the string `"pass"` when the signature verified successfully — the signature validated cryptographically (`DKIM_SIGFLAG_PASSED`) *and* the computed body hash matched the signature's `bh=` tag — and otherwise a string of the form `"fail ()"` naming the specific failure, for example `"fail (signature verification failed)"` or `"fail (key not found in DNS)"`. If `dkim_sig` is nil, the function instead returns two values, nil and the DKIM status `DKIM_STAT_INVALID`, like the other DKIM_SIGINFO accessors. + +Use `msys.validate.opendkim.get_num_sigs` and `msys.validate.opendkim.get_sig` to get a DKIM_SIGINFO object to pass to this function. + +Do not decide pass/fail by testing `msys.validate.opendkim.get_sig_errorstr` for nil: for a valid signature that function returns the literal string `"no signature error"`, never nil. This function applies the verification result the way libopendkim intends. + +Use `msys.validate.opendkim.get_stat_ar_verdict` first to handle verification statuses that carry no per-signature verdict: + +```lua +local opendkim = require("msys.validate.opendkim") + +local dkim, stat = opendkim.verify(msg) +local result = opendkim.get_stat_ar_verdict(stat) +if result == nil then + local num = opendkim.get_num_sigs(dkim) + for i = 0, num - 1 do + local sig = opendkim.get_sig(dkim, i) + if sig then + local domain = opendkim.get_sig_domain(sig) + result = opendkim.get_sig_ar_verdict(sig) + -- e.g. build "header.DKIM-Signature=@" .. domain .. "; dkim=" .. result + end + end +end +``` + +This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. + +Enable this function with the statement `require('msys.validate.opendkim');`. + + +## See Also + +[msys.validate.opendkim.get_stat_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_errorstr](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags) diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md index 77cc9d98c..99ed45bc2 100644 --- a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr.md @@ -23,9 +23,9 @@ This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. Enable this function with the statement `require('msys.validate.opendkim');`. -This function returns the error string associated with the DKIM signature (if it exists) and the DKIM status `DKIM_STAT`. +This function returns the error string associated with the DKIM signature and the DKIM status `DKIM_STAT`. For a valid DKIM signature, it returns the literal string `"no signature error"`. It returns nil only when `dkim_sig` itself is nil, together with the DKIM status `DKIM_STAT_INVALID`. -Be cautious when using this function to decide whether a signature is verified: for a valid signature, it returns the literal string `"no signature error"`, never nil. To derive a pass/fail verdict, better to use [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result). +Be cautious when using this function to decide whether a signature is verified: it never returns nil for an existing signature, and a failing signature can also report `"no signature error"` when the failure (for example, a body hash mismatch) is not recorded as a signature error. To derive a pass/fail verdict, use [msys.validate.opendkim.get_sig_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict). The DKIM status `DKIM_STAT` can be one of the following values: @@ -62,4 +62,4 @@ The DKIM status `DKIM_STAT` can be one of the following values: ## See Also -[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) +[msys.validate.opendkim.get_sig_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict), [msys.validate.opendkim.get_sig_canons](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-canons), [msys.validate.opendkim.sign](/momentum/4/lua/ref-msys-validate-opendkim-sign), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_selector](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-selector), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags), [msys.validate.opendkim.get_sig_identity](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-identity), [msys.validate.opendkim.get_sig_keysize](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-keysize), [msys.validate.opendkim.get_sig_signalg](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-signalg), [msys.validate.opendkim.get_sig_hdrsigned](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-hdrsigned) diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md deleted file mode 100644 index 1ff39262d..000000000 --- a/content/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -lastUpdated: "08/11/2026" -title: "msys.validate.opendkim.get_sig_result" -description: "msys validate opendkim get sig result Derive the Authentication Results verdict for a DKIM signature msys validate opendkim get sig result dkim sig This function returns pass when the signature verified successfully and fail with the failure reason otherwise Use it instead of testing msys validate opendkim get sig errorstr..." ---- - - -## Name - -msys.validate.opendkim.get_sig_result — Derive the Authentication-Results verdict for a DKIM signature - - -## Synopsis - -`msys.validate.opendkim.get_sig_result(dkim_sig)` - -`dkim_sig: userdata, DKIM_SIGINFO type` -## Description - -This function derives the verdict for one DKIM signature, in the form used by the `dkim` clause of an `Authentication-Results` header. It returns the string `"pass"` when the signature verified successfully — the signature validated cryptographically (`DKIM_SIGFLAG_PASSED`) *and* the computed body hash matched the signature's `bh=` tag — and otherwise a string of the form `"fail ()"` naming the specific failure, for example `"fail (signature verification failed)"` or `"fail (key not found in DNS)"`. - -Use `msys.validate.opendkim.get_num_sigs` and `msys.validate.opendkim.get_sig` to get a DKIM_SIGINFO object to pass to this function. - -Do not decide pass/fail by testing `msys.validate.opendkim.get_sig_errorstr` for nil: for a valid signature that function returns the literal string `"no signature error"`, never nil. This function applies the verification result the way libopendkim intends. - -Use `msys.validate.opendkim.get_stat_result` first to handle verification statuses that carry no per-signature verdict: - -```lua -local opendkim = require("msys.validate.opendkim") - -local dkim, stat = opendkim.verify(msg) -local result = opendkim.get_stat_result(stat) -if result == nil then - local num = opendkim.get_num_sigs(dkim) - for i = 0, num - 1 do - local sig = opendkim.get_sig(dkim, i) - if sig then - local domain = opendkim.get_sig_domain(sig) - result = opendkim.get_sig_result(sig) - -- e.g. build "header.DKIM-Signature=@" .. domain .. "; dkim=" .. result - end - end -end -``` - -This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. - -Enable this function with the statement `require('msys.validate.opendkim');`. - - -## See Also - -[msys.validate.opendkim.get_stat_result](/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig), [msys.validate.opendkim.get_sig_domain](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-domain), [msys.validate.opendkim.get_sig_errorstr](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-errorstr), [msys.validate.opendkim.get_sig_flags](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-flags) \ No newline at end of file diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict.md new file mode 100644 index 000000000..808937b40 --- /dev/null +++ b/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-ar-verdict.md @@ -0,0 +1,39 @@ +--- +lastUpdated: "08/11/2026" +title: "msys.validate.opendkim.get_stat_ar_verdict" +description: "msys validate opendkim get stat ar verdict Map a DKIM verification status with no per signature verdict to an Authentication Results result msys validate opendkim get stat ar verdict stat This function maps the DKIM STAT returned by msys validate opendkim verify to a result string or returns nil when the per signature results are authoritative..." +--- + + +## Name + +msys.validate.opendkim.get_stat_ar_verdict — Map a DKIM verification status with no per-signature verdict to an Authentication-Results result + + +## Synopsis + +`msys.validate.opendkim.get_stat_ar_verdict(stat)` + +`stat: number, DKIM_STAT returned by msys.validate.opendkim.verify` +## Description + +This function maps the overall verification status returned by `msys.validate.opendkim.verify` to a result string for the `dkim` clause of an `Authentication-Results` header, for the statuses that carry no per-signature verdict. It returns: + +* `"none (message not signed)"` – the message carried no DKIM signature (`DKIM_STAT_NOSIG`). + +* `nil` – the per-signature results are authoritative (`DKIM_STAT_OK`, `DKIM_STAT_BADSIG`, `DKIM_STAT_NOKEY`, `DKIM_STAT_CANTVRFY`, `DKIM_STAT_REVOKED`); iterate the signatures and report `msys.validate.opendkim.get_sig_ar_verdict` for each. + +* `"permerror (signature syntax error)"` – the message could not be evaluated (`DKIM_STAT_SYNTAX`). + +* `"temperror (verification status )"` – any other status, including key-retrieval tempfails (`DKIM_STAT_KEYFAIL`) and internal or resource errors; verification may succeed if retried later. + +See the [msys.validate.opendkim.get_sig_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict) page for a usage example combining both functions. + +This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. + +Enable this function with the statement `require('msys.validate.opendkim');`. + + +## See Also + +[msys.validate.opendkim.get_sig_ar_verdict](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-ar-verdict), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig) diff --git a/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md b/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md deleted file mode 100644 index 4fc7e38ad..000000000 --- a/content/momentum/4/lua/ref-msys-validate-opendkim-get-stat-result.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -lastUpdated: "08/11/2026" -title: "msys.validate.opendkim.get_stat_result" -description: "msys validate opendkim get stat result Map a DKIM verification status with no per signature verdict to an Authentication Results result msys validate opendkim get stat result stat This function maps the DKIM STAT returned by msys validate opendkim verify to a result string or returns nil when the per signature results are authoritative..." ---- - - -## Name - -msys.validate.opendkim.get_stat_result — Map a DKIM verification status with no per-signature verdict to an Authentication-Results result - - -## Synopsis - -`msys.validate.opendkim.get_stat_result(stat)` - -`stat: number, DKIM_STAT returned by msys.validate.opendkim.verify` -## Description - -This function maps the overall verification status returned by `msys.validate.opendkim.verify` to a result string for the `dkim` clause of an `Authentication-Results` header, for the statuses that carry no per-signature verdict. It returns: - -* `"none (message not signed)"` – the message carried no DKIM signature (`DKIM_STAT_NOSIG`). - -* `nil` – the per-signature results are authoritative (`DKIM_STAT_OK`, `DKIM_STAT_BADSIG`, `DKIM_STAT_NOKEY`, `DKIM_STAT_CANTVRFY`, `DKIM_STAT_REVOKED`); iterate the signatures and report `msys.validate.opendkim.get_sig_result` for each. - -* `"permerror (signature syntax error)"` – the message could not be evaluated (`DKIM_STAT_SYNTAX`). - -* `"temperror (verification status )"` – any other status, including key-retrieval tempfails (`DKIM_STAT_KEYFAIL`) and internal or resource errors; verification may succeed if retried later. - -See the [msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result) page for a usage example combining both functions. - -This function requires the [`opendkim`](/momentum/4/modules/opendkim) module. - -Enable this function with the statement `require('msys.validate.opendkim');`. - - -## See Also - -[msys.validate.opendkim.get_sig_result](/momentum/4/lua/ref-msys-validate-opendkim-get-sig-result), [msys.validate.opendkim.verify](/momentum/4/lua/ref-msys-validate-opendkim-verify), [msys.validate.opendkim.get_num_sigs](/momentum/4/lua/ref-msys-validate-opendkim-get-num-sigs), [msys.validate.opendkim.get_sig](/momentum/4/lua/ref-msys-validate-opendkim-get-sig) \ No newline at end of file