diff options
-rw-r--r-- | data/example_new.conf | 23 | ||||
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | src/config.c | 8 |
3 files changed, 27 insertions, 6 deletions
diff --git a/data/example_new.conf b/data/example_new.conf index e254bcabf..2cd73f917 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -204,6 +204,29 @@ networkinfo { } /* + * [OPTIONAL] Mail Config + * + * This section contains settings related to the use of e-mail from Services. + * If the usemail directive is set to yes, unless specified otherwise, all other + * directives are required. + */ +mail +{ +# UseMail [OPTIONAL] +# +# This option enables the mail commands in Services. You may choose +# to disable it if you have no sendmail-compatible mailer installed. +# This setting is [REQUIRED] if NSEmailReg is enabled. + /* + * If set, this option enables the mail commands in Services. You may choose + * to disable it if you have no sendmail-compatible mailer installed. While + * this directive (and entire block) is optional, it is required if the + * nickserv:emailregistration is set to yes. + */ + usemail = yes +} + +/* * [REQUIRED] NickServ Config * * This section is used to set up the Nickname Registration Service pseudo-client. diff --git a/include/extern.h b/include/extern.h index db4936b4d..1b1d8a75d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -310,7 +310,7 @@ E int UseTS6; E char **HostSetters; E int HostNumber; -E int UseMail; +E bool UseMail; E char *SendMailPath; E char *SendFrom; E int RestrictMail; diff --git a/src/config.c b/src/config.c index b3762c45f..3e143818c 100644 --- a/src/config.c +++ b/src/config.c @@ -105,7 +105,7 @@ int NickRegDelay; int UseSVSHOLD; int NewsCount; -int UseMail; +bool UseMail; char *SendMailPath; char *SendFrom; int RestrictMail; @@ -636,6 +636,7 @@ int ServerConfig::Read(bool bail) {"nickserv", "restrictgetpass", "no", new ValueContainerBool(&NSRestrictGetPass), DT_BOOLEAN, NoValidation}, {"nickserv", "nicktracking", "no", new ValueContainerBool(&NSNickTracking), DT_BOOLEAN, NoValidation}, {"nickserv", "addaccessonreg", "no", new ValueContainerBool(&NSAddAccessOnReg), DT_BOOLEAN, NoValidation}, + {"mail", "usemail", "no", new ValueContainerBool(&UseMail), DT_BOOLEAN, ValidateEmailReg}, {"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}, @@ -1346,7 +1347,6 @@ Directive directives[] = { {"StrictPasswords", {{PARAM_SET, PARAM_RELOAD, &StrictPasswords}}}, {"TimeoutCheck", {{PARAM_TIME, PARAM_RELOAD, &TimeoutCheck}}}, {"UpdateTimeout", {{PARAM_TIME, PARAM_RELOAD, &UpdateTimeout}}}, - {"UseMail", {{PARAM_SET, PARAM_RELOAD, &UseMail}}}, {"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}}, {"UseStrictPrivMsg", {{PARAM_SET, PARAM_RELOAD, &UseStrictPrivMsg}}}, {"UserKey1", {{PARAM_POSINT, PARAM_RELOAD, &UserKey1}}}, @@ -1959,9 +1959,7 @@ int read_config(int reload) * * rob **/ - if (NSEmailReg) { - CHECK(UseMail); - } else { + if (!NSEmailReg) { delete [] PreNickDBName; PreNickDBName = NULL; NSRExpire = 0; |