diff --git a/src/elogd.c b/src/elogd.c index bdf55b26..566cd5ab 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -2101,6 +2101,9 @@ int sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to, char *text, c n = strbreak(to, list, 1024, ","); for (i = 0; i < n; i++) { + if (list[i] == 0 || strchr(list[i], '@') == NULL) + continue; + snprintf(str, strsize - 1, "RCPT TO: <%s>\r\n", list[i]); send(s, str, strlen(str), 0); if (verbose) @@ -18209,7 +18212,10 @@ int compose_email(LOGBOOK * lbs, char *mail_to, int message_id, if (status < 0) { sprintf(str, loc("Error sending Email via \"%s\""), smtp_host); - strlcat(str, ": ", sizeof(str)); + if (error[0]) { + strlcat(str, ": ", sizeof(str)); + strlcat(str, error, sizeof(str)); + } url_encode(str, sizeof(str)); sprintf(mail_param, "?error=%s", str); } else if (error[0]) {