mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented 'Default email from'
SVN revision: 1790
This commit is contained in:
parent
08a8551c3b
commit
519c542b70
@ -2056,6 +2056,9 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
|
|||||||
<li>
|
<li>
|
||||||
<b><code>Use Email From = <string></code></b>
|
<b><code>Use Email From = <string></code></b>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<b><code>Default Email From = <string></code></b>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Use Email Heading = <string></code></b>
|
<b><code>Use Email Heading = <string></code></b>
|
||||||
</li>
|
</li>
|
||||||
@ -2115,11 +2118,12 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
|
|||||||
for the "<i>From:</i>" field in the email. Since more and more email
|
for the "<i>From:</i>" field in the email. Since more and more email
|
||||||
servers do not accept invalid <i>"From:"</i> addresses in order to reduce
|
servers do not accept invalid <i>"From:"</i> addresses in order to reduce
|
||||||
spam mail, it might be important that a "real" email address is used in
|
spam mail, it might be important that a "real" email address is used in
|
||||||
the <i>"From:"</i> field. By default, the email address of the currently
|
the <i>"From:"</i> field. If <b><code>Use Email From</code></b> is
|
||||||
|
present, it is always used. If not, the email address of the currently
|
||||||
logged in user is used for the <i>"From:"</i> field. If no user is logged
|
logged in user is used for the <i>"From:"</i> field. If no user is logged
|
||||||
in, or the current user has not specified a email address in the password
|
in, or the current user has not specified a email address in the password
|
||||||
database, the setting of the option <b><code>Use Email From</code></b> is
|
database, the setting of the option <b><code>Default Email From</code></b>
|
||||||
used for the "<i>From:</i>" field. Only if this option is not specified,
|
is used for the "<i>From:</i>" field. Only if this option is not specified,
|
||||||
a generic address <i>ELOG@<hostname></i> is used, which might be
|
a generic address <i>ELOG@<hostname></i> is used, which might be
|
||||||
rejected by the SMTP server however.
|
rejected by the SMTP server however.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -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];
|
char slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH];
|
||||||
int i;
|
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));
|
strlcpy(email_from_name, getparam("full_name"), sizeof(email_from_name));
|
||||||
strlcat(email_from_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, getparam("user_email"), sizeof(email_from_name));
|
||||||
strlcat(email_from_name, ">", sizeof(email_from_name));
|
strlcat(email_from_name, ">", sizeof(email_from_name));
|
||||||
strlcpy(email_from, getparam("user_email"), sizeof(email_from));
|
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, str, sizeof(email_from));
|
||||||
strlcpy(email_from_name, str, sizeof(email_from));
|
strlcpy(email_from_name, str, sizeof(email_from));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user