diff --git a/doc/config.html b/doc/config.html index 3be796b4..8f9bf6e6 100755 --- a/doc/config.html +++ b/doc/config.html @@ -2056,6 +2056,9 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
Use Email From = <string>
Default Email From = <string>
+ Use Email Heading = <string>
Use Email From is
+ present, it is always used. If not, the email address of the currently
logged in user is used for the "From:" field. If no user is logged
in, or the current user has not specified a email address in the password
- database, the setting of the option Use Email From is
- used for the "From:" field. Only if this option is not specified,
+ database, the setting of the option Default Email From
+ is used for the "From:" field. Only if this option is not specified,
a generic address ELOG@<hostname> is used, which might be
rejected by the SMTP server however.
diff --git a/src/elogd.c b/src/elogd.c
index e6b6f1bb..974eea9c 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -3386,13 +3386,16 @@ void retrieve_email_from(LOGBOOK * lbs, char *ret, char *ret_name, char attrib[M
char slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH];
int i;
- if (isparam("full_name") && isparam("user_email")) {
+ if (getcfg(lbs->name, "Use Email from", str, sizeof(str))) {
+ strlcpy(email_from, str, sizeof(email_from));
+ strlcpy(email_from_name, str, sizeof(email_from));
+ } else if (isparam("full_name") && isparam("user_email")) {
strlcpy(email_from_name, getparam("full_name"), sizeof(email_from_name));
strlcat(email_from_name, " <", sizeof(email_from_name));
strlcat(email_from_name, getparam("user_email"), sizeof(email_from_name));
strlcat(email_from_name, ">", sizeof(email_from_name));
strlcpy(email_from, getparam("user_email"), sizeof(email_from));
- } else if (getcfg(lbs->name, "Use Email from", str, sizeof(str))) {
+ } else if (getcfg(lbs->name, "Default Email from", str, sizeof(str))) {
strlcpy(email_from, str, sizeof(email_from));
strlcpy(email_from_name, str, sizeof(email_from));
} else {