mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Fixed problem with 'omit email to'
SVN revision: 1565
This commit is contained in:
parent
7c741a7936
commit
a03fc49964
20
src/elogd.c
20
src/elogd.c
@ -1601,7 +1601,7 @@ INT recv_string(int sock, char *buffer, INT buffer_size, INT millisec)
|
|||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
void compose_email_header(char *subject, char *from, char *to,
|
void compose_email_header(LOGBOOK *lbs, char *subject, char *from, char *to,
|
||||||
char *url, char *mail_text, int size, int mail_encoding,
|
char *url, char *mail_text, int size, int mail_encoding,
|
||||||
int n_attachments, char *multipart_boundary)
|
int n_attachments, char *multipart_boundary)
|
||||||
{
|
{
|
||||||
@ -1644,7 +1644,12 @@ void compose_email_header(char *subject, char *from, char *to,
|
|||||||
setlocale(LC_ALL, str);
|
setlocale(LC_ALL, str);
|
||||||
|
|
||||||
strlcat(mail_text, "To: ", size);
|
strlcat(mail_text, "To: ", size);
|
||||||
strlcat(mail_text, to, size);
|
|
||||||
|
if (getcfg(lbs->name, "Omit Email to", str, sizeof(str)) && atoi(str) == 1)
|
||||||
|
strlcat(mail_text, "ELOG", size);
|
||||||
|
else
|
||||||
|
strlcat(mail_text, to, size);
|
||||||
|
|
||||||
strlcat(mail_text, "\r\n", size);
|
strlcat(mail_text, "\r\n", size);
|
||||||
|
|
||||||
snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "From: %s\r\n", from);
|
snprintf(mail_text + strlen(mail_text), size - strlen(mail_text) - 1, "From: %s\r\n", from);
|
||||||
@ -10518,7 +10523,7 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
retrieve_email_from(lbs, mail_from, mail_from_name, NULL);
|
retrieve_email_from(lbs, mail_from, mail_from_name, NULL);
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
compose_email_header(loc("Your ELOG account has been activated"), mail_from_name,
|
compose_email_header(lbs, loc("Your ELOG account has been activated"), mail_from_name,
|
||||||
getparam("new_user_email"), NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
getparam("new_user_email"), NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
||||||
|
|
||||||
sprintf(mail_text, loc("Your ELOG account has been activated on host"));
|
sprintf(mail_text, loc("Your ELOG account has been activated on host"));
|
||||||
@ -10595,7 +10600,7 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
loc("Logbook"), url, getparam("new_user_name"), pl);
|
loc("Logbook"), url, getparam("new_user_name"), pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
compose_email_header(subject, mail_from_name, email_addr,
|
compose_email_header(lbs, subject, mail_from_name, email_addr,
|
||||||
NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
NULL, mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
||||||
sendmail(lbs, smtp_host, mail_from, email_addr, mail_text, NULL, 0);
|
sendmail(lbs, smtp_host, mail_from, email_addr, mail_text, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -10943,7 +10948,7 @@ void show_forgot_pwd_page(LOGBOOK * lbs)
|
|||||||
strlcat(mail_text, "\r\n\r\n", sizeof(mail_text));
|
strlcat(mail_text, "\r\n\r\n", sizeof(mail_text));
|
||||||
sprintf(mail_text + strlen(mail_text), "ELOG Version %s\r\n", VERSION);
|
sprintf(mail_text + strlen(mail_text), "ELOG Version %s\r\n", VERSION);
|
||||||
|
|
||||||
compose_email_header(subject, mail_from_name, user_email, NULL,
|
compose_email_header(lbs, subject, mail_from_name, user_email, NULL,
|
||||||
mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
mail_text, sizeof(mail_text), FALSE, 0, NULL);
|
||||||
if (sendmail(lbs, smtp_host, mail_from, user_email, mail_text, error, sizeof(error))
|
if (sendmail(lbs, smtp_host, mail_from, user_email, mail_text, error, sizeof(error))
|
||||||
!= -1) {
|
!= -1) {
|
||||||
@ -17799,10 +17804,7 @@ int compose_email(LOGBOOK * lbs, char *mail_to, int message_id,
|
|||||||
mail_text = xmalloc(mail_text_size);
|
mail_text = xmalloc(mail_text_size);
|
||||||
mail_text[0] = 0;
|
mail_text[0] = 0;
|
||||||
|
|
||||||
if (getcfg(lbs->name, "Omit Email to", str, sizeof(str)) && atoi(str) == 1)
|
compose_email_header(lbs, subject, mail_from_name, mail_to, url, mail_text, mail_text_size, mail_encoding,
|
||||||
strcpy(mail_to, "ELOG");
|
|
||||||
|
|
||||||
compose_email_header(subject, mail_from_name, mail_to, url, mail_text, mail_text_size, mail_encoding,
|
|
||||||
n_attachments, multipart_boundary);
|
n_attachments, multipart_boundary);
|
||||||
|
|
||||||
if (mail_encoding & 1)
|
if (mail_encoding & 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user