OperServ: enforce FORBID EMAIL at registration and SET EMAIL

FORBID accepted and stored EMAIL patterns, but nothing ever checked them:
a forbidden address still registered and could be set via NickServ SET
EMAIL. Both paths now reject a matching address (new ForbiddenEmail
outcome), matching how NICK and CHAN forbids already gate registration.
This commit is contained in:
Jean Chevronnet 2026-07-16 03:11:57 +00:00
parent 01ea0fa95e
commit b749cd2969
No known key found for this signature in database
4 changed files with 28 additions and 0 deletions

View file

@ -220,6 +220,12 @@ impl Engine {
let Some(creds) = creds else {
return reg_reply(&reply, RegOutcome::Internal, account);
};
// A forbidden email pattern (OperServ FORBID EMAIL) blocks registration.
if let Some(addr) = &email {
if self.db.is_forbidden("EMAIL", addr).is_some() {
return reg_reply(&reply, RegOutcome::ForbiddenEmail, account);
}
}
let addr = email.clone();
let outcome = match self.db.register_prepared(account, creds, email) {
Ok(()) if self.db.is_verified(account) => RegOutcome::Ok,