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

@ -43,6 +43,9 @@ pub struct Expire {
pub accounts_days: u64,
#[serde(default)]
pub channels_days: u64,
// Days before expiry to email a warning to the owner (0 = no warning email).
#[serde(default)]
pub warn_days: u64,
}
impl Expire {
@ -53,6 +56,10 @@ impl Expire {
pub fn channel_ttl(&self) -> Option<u64> {
(self.channels_days > 0).then(|| self.channels_days * 86_400)
}
// The warning lead time in seconds, or None if warnings are off.
pub fn warn_ttl(&self) -> Option<u64> {
(self.warn_days > 0).then(|| self.warn_days * 86_400)
}
}
// The staff audit feed: notable service actions are announced to this channel