mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Added warning it email notification buffer size exceeded
SVN revision: 1574
This commit is contained in:
parent
9233c63971
commit
fa8b4d9ac7
@ -1925,6 +1925,12 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, char *text, c
|
|||||||
/* add ".<CR>" to signal end of message */
|
/* add ".<CR>" to signal end of message */
|
||||||
strlcat(str, ".\r\n", strsize);
|
strlcat(str, ".\r\n", strsize);
|
||||||
|
|
||||||
|
/* check if buffer exceeded */
|
||||||
|
if (strlen(str) == strsize-1) {
|
||||||
|
strlcpy(error, loc("Entry size too large for email notification"), error_size);
|
||||||
|
goto smtp_error;
|
||||||
|
}
|
||||||
|
|
||||||
send(s, str, strlen(str), 0);
|
send(s, str, strlen(str), 0);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
efputs(str);
|
efputs(str);
|
||||||
@ -17906,10 +17912,12 @@ int compose_email(LOGBOOK * lbs, char *mail_to, int message_id,
|
|||||||
|
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
||||||
|
strlcat(str, ": ", sizeof(str));
|
||||||
url_encode(str, sizeof(str));
|
url_encode(str, sizeof(str));
|
||||||
sprintf(mail_param, "?error=%s", str);
|
sprintf(mail_param, "?error=%s", str);
|
||||||
} else if (error[0]) {
|
} else if (error[0]) {
|
||||||
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
sprintf(str, loc("Error sending Email via <i>\"%s\"</i>"), smtp_host);
|
||||||
|
strlcat(str, ": ", sizeof(str));
|
||||||
strlcat(str, error, sizeof(str));
|
strlcat(str, error, sizeof(str));
|
||||||
url_encode(str, sizeof(str));
|
url_encode(str, sizeof(str));
|
||||||
sprintf(mail_param, "?error=%s", str);
|
sprintf(mail_param, "?error=%s", str);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user