From 1c5268c41cef9d58b21ba20fa033737a3a31dbba Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 18 Jan 2006 11:28:13 +0000 Subject: [PATCH] Improved error display in sendmail() SVN revision: 1614 --- src/elogd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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]) {