diff options
author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-09 23:44:34 +0000 |
---|---|---|
committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-09 23:44:34 +0000 |
commit | fc21dbc2ec9f83dde90f69e42e2181a6455903dd (patch) | |
tree | 73c9a15524510c97d041421065a8a372d9bdabb2 | |
parent | 93985d17a8f6ac33d4174df2073a2cf79e9b30c5 (diff) |
Added sendfrom directive to mail block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1623 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | data/example_new.conf | 6 | ||||
-rw-r--r-- | src/config.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/data/example_new.conf b/data/example_new.conf index a06bf08f6..dff8b7644 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -240,6 +240,12 @@ mail * to be used. */ sendmailpath = "/usr/sbin/sendmail -t" + + /* + * This is the e-mail address from which all the e-mails are to be sent from. + * It should really exist. + */ + sendfrom = "services@localhost.net" } /* diff --git a/src/config.c b/src/config.c index 02525e92b..03edb963a 100644 --- a/src/config.c +++ b/src/config.c @@ -546,7 +546,7 @@ bool ValidateNickLen(ServerConfig *, const char *, const char *, ValueItem &data bool ValidateMail(ServerConfig *, const char *tag, const char *value, ValueItem &data) { if (UseMail) { - if (static_cast<std::string>(value) == "sendmailpath") { + if (static_cast<std::string>(value) == "sendmailpath" || static_cast<std::string>(value) == "sendfrom") { if (!*data.GetString()) throw ConfigException(static_cast<std::string>("The value for <") + tag + ":" + value + "> cannot be empty when e-mail is enabled!"); } } @@ -664,6 +664,7 @@ int ServerConfig::Read(bool bail) {"nickserv", "addaccessonreg", "no", new ValueContainerBool(&NSAddAccessOnReg), DT_BOOLEAN, NoValidation}, {"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}, {"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}, @@ -1362,7 +1363,6 @@ Directive directives[] = { {PARAM_STRING, 0, &RemotePassword3}}}, {"RestrictMail", {{PARAM_SET, PARAM_RELOAD, &RestrictMail}}}, {"RestrictOperNicks", {{PARAM_SET, PARAM_RELOAD, &RestrictOperNicks}}}, - {"SendFrom", {{PARAM_STRING, PARAM_RELOAD, &SendFrom}}}, {"HideStatsO", {{PARAM_SET, PARAM_RELOAD, &HideStatsO}}}, {"GlobalOnCycle", {{PARAM_SET, PARAM_RELOAD, &GlobalOnCycle}}}, {"AnonymousGlobal", {{PARAM_SET, PARAM_RELOAD, &AnonymousGlobal}}}, @@ -1899,10 +1899,6 @@ int read_config(int reload) } } - if (UseMail) { - CHECK(SendFrom); - } - if (GlobalOnCycle) { if (!GlobalOnCycleMessage && !GlobalOnCycleUP) { alog("GlobalOnCycleMessage and GlobalOnCycleUP are not defined; disabling GlobalOnCycle"); |