if (task->err != NULL) {
msg_info_session("cannot learn <%s>: %e",
- MESSAGE_FIELD(task, message_id), task->err);
+ MESSAGE_FIELD_CHECK(task, message_id), task->err);
rspamd_controller_send_error(conn_ent, task->err->code, "%s",
task->err->message);
msg_info_task("<%s> learned message as %s: %s",
rspamd_inet_address_to_string(session->from_addr),
session->is_spam ? "spam" : "ham",
- MESSAGE_FIELD(task, message_id));
+ MESSAGE_FIELD_CHECK(task, message_id));
rspamd_controller_send_string(conn_ent, "{\"success\":true}");
return TRUE;
}
if (!rspamd_task_process(task, RSPAMD_TASK_PROCESS_LEARN)) {
msg_info_task("cannot learn <%s>: %e",
- MESSAGE_FIELD(task, message_id), task->err);
+ MESSAGE_FIELD_CHECK(task, message_id), task->err);
if (task->err) {
rspamd_controller_send_error(conn_ent, task->err->code, "%s",
msg_info_task("<%s> learned message as %s: %s",
rspamd_inet_address_to_string(session->from_addr),
session->is_spam ? "spam" : "ham",
- MESSAGE_FIELD(task, message_id));
+ MESSAGE_FIELD_CHECK(task, message_id));
rspamd_controller_send_string(conn_ent, "{\"success\":true}");
}
if (!rspamd_task_process(task, RSPAMD_TASK_PROCESS_LEARN)) {
msg_warn_session("<%s> message cannot be processed",
- MESSAGE_FIELD(task, message_id));
+ MESSAGE_FIELD_CHECK(task, message_id));
goto end;
}