add pm banlist:auth and pm banlist:auto

This commit is contained in:
Aine
2023-09-25 21:59:23 +03:00
parent b413e5871a
commit 18f1113d33
7 changed files with 136 additions and 7 deletions

View File

@@ -30,6 +30,8 @@ const (
commandSpamlistReset = "spam:reset"
commandDelete = "delete"
commandBanlist = "banlist"
commandBanlistAuto = "banlist:auto"
commandBanlistAuth = "banlist:auth"
commandBanlistAdd = "banlist:add"
commandBanlistRemove = "banlist:remove"
commandBanlistReset = "banlist:reset"
@@ -302,6 +304,16 @@ func (b *Bot) initCommands() commandList {
description: "Enable/disable banlist and show current values",
allowed: b.allowAdmin,
},
{
key: commandBanlistAuth,
description: "Enable/disable automatic banning of IP addresses when they try to auth with invalid credentials",
allowed: b.allowAdmin,
},
{
key: commandBanlistAuto,
description: "Enable/disable automatic banning of IP addresses when they try to send invalid emails",
allowed: b.allowAdmin,
},
{
key: commandBanlistAdd,
description: "Ban an IP",
@@ -387,6 +399,10 @@ func (b *Bot) handle(ctx context.Context) {
b.runGreylist(ctx, commandSlice)
case commandBanlist:
b.runBanlist(ctx, commandSlice)
case commandBanlistAuth:
b.runBanlistAuth(ctx, commandSlice)
case commandBanlistAuto:
b.runBanlistAuto(ctx, commandSlice)
case commandBanlistAdd:
b.runBanlistAdd(ctx, commandSlice)
case commandBanlistRemove: