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

@ -166,7 +166,9 @@ fn to_wire(entry: &LogEntry) -> Option<ReplicationEvent> {
| Event::AccountNoExpire { .. }
| Event::ChannelNoExpire { .. }
| Event::AkillAdded { .. }
| Event::AkillRemoved { .. } => return None,
| Event::AkillRemoved { .. }
| Event::AccountExpiryWarned { .. }
| Event::ChannelExpiryWarned { .. } => return None,
};
Some(ReplicationEvent { origin: entry.origin().to_string(), seq: entry.seq(), lamport: entry.lamport(), kind: Some(kind) })
}
@ -425,6 +427,7 @@ mod tests {
vhost_request: None,
last_seen: 111,
noexpire: false,
expiry_warned: false,
};
let registered = LogEntry::for_test("A", 0, 1, Event::AccountRegistered(Box::new(acct)));
let wire = to_wire(&registered).expect("account registration replicates");