Email owners before inactivity-expiry drops their account or channel

When [expire] warn_days is set and email is configured, the expiry sweep
now emails a heads-up to owners entering the warning window (inactive past
the threshold minus the lead time, but not yet expired) for whom an
address is on file — the founder's address for a channel. It's a chance to
keep the record by simply using it before the deadline.

Each idle spell warns at most once: a new AccountExpiryWarned /
ChannelExpiryWarned event marks the record, and the next activity stamp
clears the mark so a later idle spell warns afresh. The warning email is a
first-class api template (fedserv_api:📧:expiry_warning), alongside
the reset and confirm mails.
This commit is contained in:
Jean Chevronnet 2026-07-14 00:18:43 +00:00
parent 3a6239bbd9
commit 57e104e510
No known key found for this signature in database
7 changed files with 214 additions and 12 deletions

View file

@ -113,7 +113,7 @@ async fn main() -> Result<()> {
engine.lock().await.set_sid(cfg.server.sid.clone());
engine.lock().await.set_log_channel(cfg.log.as_ref().map(|l| l.channel.clone()));
if let Some(expire) = &cfg.expire {
engine.lock().await.set_expiry(expire.account_ttl(), expire.channel_ttl());
engine.lock().await.set_expiry(expire.account_ttl(), expire.channel_ttl(), expire.warn_ttl());
}
if let Some(gossip) = cfg.gossip.clone() {