summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/example_new.conf6
-rw-r--r--src/config.c8
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");