* So we check if a task has non-http format then we check for such a line
* at the beginning to avoid errors
*/
- if (!(task->flags & RSPAMD_TASK_FLAG_JSON)) {
+ if (!(task->flags & RSPAMD_TASK_FLAG_JSON) || (task->flags &
+ RSPAMD_TASK_FLAG_LOCAL_CLIENT)) {
if (len > sizeof ("From ") - 1) {
if (memcmp (p, "From ", sizeof ("From ") - 1) == 0) {
/* Skip to CRLF */
"message contains two parts but they are in different multi-parts");
}
}
- else {
- debug_task (
- "message has too many text parts, so do not try to compare "
- "them with each other");
- }
for (i = 0; i < task->parts->len; i ++) {
struct rspamd_mime_part *part;
#define DELIVER_TO_HEADER "Deliver-To"
#define NO_LOG_HEADER "Log"
#define MLEN_HEADER "Message-Length"
+#define USER_AGENT_HEADER "User-Agent"
static GQuark
debug_task ("extended urls information");
}
}
+ IF_HEADER (USER_AGENT_HEADER) {
+ if (hv_tok->len == 6 &&
+ rspamd_lc_cmp (hv_tok->begin, "rspamc", 6) == 0) {
+ task->flags |= RSPAMD_TASK_FLAG_LOCAL_CLIENT;
+ }
+ }
break;
case 'l':
case 'L':
#define RSPAMD_TASK_FLAG_HAS_SPAM_TOKENS (1 << 20)
#define RSPAMD_TASK_FLAG_HAS_HAM_TOKENS (1 << 21)
#define RSPAMD_TASK_FLAG_EMPTY (1 << 22)
+#define RSPAMD_TASK_FLAG_LOCAL_CLIENT (1 << 23)
#define RSPAMD_TASK_IS_SKIPPED(task) (((task)->flags & RSPAMD_TASK_FLAG_SKIP))
#define RSPAMD_TASK_IS_JSON(task) (((task)->flags & RSPAMD_TASK_FLAG_JSON))