Flush now sorts accounts instead of walking a map, so notice order is stable. A failed node-notifier.send keeps its mail pending and retries at most once a minute, without holding up other accounts' notices, and the failure is kept in the Store for a new health tool (mail_notifier_health) that is unhealthy past ten minutes of failure. The burst rule now follows the lead's reading of ADR 0378 S9: within an account's sliding minute, the first three qualifying mails are shown one by one and the rest are folded into one notice at the window's end; there is no separate quiet-gap timer. The dedupe key is the account and message id, falling back to folder/uidvalidity/uid only when no message id is given, so a UIDVALIDITY reset cannot suppress a new mail, and a redelivered event already buffered is never recounted. status now lists every granted account, not only those with a notice, and caches mail-store.accounts for a minute.
86 lines
1.6 KiB
JSON
86 lines
1.6 KiB
JSON
{
|
|
"module": "mesh-mail-notifier",
|
|
"version": "1",
|
|
"runs-as": "mesh-mail-notifier",
|
|
"claims": [
|
|
{
|
|
"name": "mail-notifier",
|
|
"scope": "node",
|
|
"serves": ["status"]
|
|
}
|
|
],
|
|
"consumes": [
|
|
"mesh-mail.mail.*.message.added"
|
|
],
|
|
"invokes": [
|
|
"seat:node-notifier.send",
|
|
"seat:mail-store.accounts"
|
|
],
|
|
"emits": [
|
|
"shown"
|
|
],
|
|
"state": [
|
|
{
|
|
"name": "shown",
|
|
"ttl-seconds": 2592000
|
|
}
|
|
],
|
|
"tools": [
|
|
"mail-notifier.status",
|
|
"mail_notifier_health"
|
|
],
|
|
"own-secrets": {
|
|
"broker": "${dir:state}/broker"
|
|
},
|
|
"secrets-owner": "mesh-mail-notifier",
|
|
"resources": [
|
|
{
|
|
"id": "account",
|
|
"type": "user",
|
|
"name": "mesh-mail-notifier",
|
|
"shell": "/usr/bin/nologin",
|
|
"home": "/var/lib/mesh-mail-notifier"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "mesh-mail-notifier",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "notify",
|
|
"type": "process",
|
|
"name": "mesh-mail-notifier-notify",
|
|
"artifact": "tools",
|
|
"run": [
|
|
"./mesh-mail-notifier",
|
|
"notify"
|
|
],
|
|
"health": {
|
|
"kind": "tool",
|
|
"tool": "mail_notifier_health",
|
|
"interval": "60s",
|
|
"timeout": "10s",
|
|
"looks": 2,
|
|
"grace": "120s"
|
|
}
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/mesh-mail-notifier",
|
|
"binary": "mesh-mail-notifier",
|
|
"loads": [
|
|
"mesh-mail-notifier"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|