diff options
-rw-r--r-- | data/example_new.conf | 13 | ||||
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | src/config.c | 6 |
3 files changed, 16 insertions, 5 deletions
diff --git a/data/example_new.conf b/data/example_new.conf index 154683c80..916ba286a 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -256,7 +256,18 @@ mail * create a special user for this; remember to NEVER launch Services as * root). */ - restrictmail = yes + restrict = yes + + /* + * This controls the minimum amount of time an user must wait before sending + * another e-mail after they have sent one. It also controls the minimum time + * an user must wait before they can receive another e-mail. This directive + * is optional, but recommended. + * + * This feature prevents users from being mail bombed using Services and + * it is highly recommended that it be used. + */ + delay = 5m } /* diff --git a/include/extern.h b/include/extern.h index 9ff543839..99f049200 100644 --- a/include/extern.h +++ b/include/extern.h @@ -314,7 +314,7 @@ E bool UseMail; E char *SendMailPath; E char *SendFrom; E bool RestrictMail; -E int MailDelay; +E time_t MailDelay; E int DontQuoteAddresses; E int NSDefFlags; diff --git a/src/config.c b/src/config.c index 0709f92a7..d09f089fc 100644 --- a/src/config.c +++ b/src/config.c @@ -109,7 +109,7 @@ bool UseMail; char *SendMailPath; char *SendFrom; bool RestrictMail; -int MailDelay; +time_t MailDelay; int DontQuoteAddresses; static std::string NSDefaults; @@ -665,7 +665,8 @@ int ServerConfig::Read(bool bail) {"mail", "usemail", "no", new ValueContainerBool(&UseMail), DT_BOOLEAN, ValidateEmailReg}, {"mail", "sendmailpath", "", new ValueContainerChar(&SendMailPath), DT_CHARPTR, ValidateMail}, {"mail", "sendfrom", "", new ValueContainerChar(&SendFrom), DT_CHARPTR, ValidateMail}, - {"mail", "restrictmail", "no", new ValueContainerBool(&RestrictMail), DT_BOOLEAN, NoValidation}, + {"mail", "restrict", "no", new ValueContainerBool(&RestrictMail), DT_BOOLEAN, NoValidation}, + {"mail", "delay", "0", new ValueContainerTime(&MailDelay), DT_TIME, NoValidation}, {"chanserv", "nick", "ChanServ", new ValueContainerChar(&s_ChanServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"chanserv", "description", "Channel Registration Service", new ValueContainerChar(&desc_ChanServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"chanserv", "database", "chan.db", new ValueContainerChar(&ChanDBName), DT_CHARPTR, ValidateNotEmpty}, @@ -1341,7 +1342,6 @@ Directive directives[] = { {"LocalAddress", {{PARAM_STRING, 0, &LocalHost}, {PARAM_PORT, PARAM_OPTIONAL, &LocalPort}}}, {"LogUsers", {{PARAM_SET, PARAM_RELOAD, &LogUsers}}}, - {"MailDelay", {{PARAM_TIME, PARAM_RELOAD, &MailDelay}}}, {"MysqlHost", {{PARAM_STRING, PARAM_RELOAD, &MysqlHost}}}, {"MysqlUser", {{PARAM_STRING, PARAM_RELOAD, &MysqlUser}}}, {"MysqlPass", {{PARAM_STRING, PARAM_RELOAD, &MysqlPass}}}, |