Skip to content

Commit

Permalink
Fix messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Feb 5, 2025
1 parent 4f412ff commit d6ab54e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2071,10 +2071,10 @@ bool Utils::sendMail(lua_State *vm, char *from, char *to, char *cc,
ret_str = curl_easy_strerror(res);

if (res != CURLE_OK) {
ntop->getTrace()->traceEvent(TRACE_WARNING,
"Unable to send email to (%s): %s. Run "
"ntopng with -v6 for more details.",
ntop->getTrace()->traceEvent(TRACE_WARNING, "Unable to send email to (%s): %s",
smtp_server, curl_easy_strerror(res));
if (ntop->getTrace()->get_trace_level() < TRACE_LEVEL_DEBUG && !verbose)
ntop->getTrace()->traceEvent(TRACE_WARNING, "Run ntopng with -v6 for more details");
ret = false;
}

Expand All @@ -2100,15 +2100,17 @@ bool Utils::sendMail(lua_State *vm, char *from, char *to, char *cc,
lua_newtable(vm);
lua_push_bool_table_entry(vm, "success", ret);
lua_push_str_table_entry(vm, "msg", ret_str);
} else if (!ret)
} else if (!ret) {
/*
If not lua VM has been passed, in case of error, a message is logged to
stdout
*/
ntop->getTrace()->traceEvent(TRACE_WARNING,
"Unable to send email to (%s): %s. Run ntopng "
"with -v6 for more details.",
ntop->getTrace()->traceEvent(TRACE_WARNING, "Unable to send email to (%s): %s",
smtp_server, ret_str);
if (ntop->getTrace()->get_trace_level() < TRACE_LEVEL_DEBUG && !verbose)
ntop->getTrace()->traceEvent(TRACE_WARNING, "Run ntopng with -v6 for more details");
}

return ret;
}

Expand Down

0 comments on commit d6ab54e

Please sign in to comment.