aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-23 15:48:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-23 15:48:43 +0100
commit0b4c54e21874d6d622ab6820e36071c071e0c3e1 (patch)
tree6304c29b9a455e7b029ec33a95f1b4fc2ab4f72c /src/libserver
parent0f67ab52981f2c96abd2a43b9768b8e2df1eb777 (diff)
downloadrspamd-0b4c54e21874d6d622ab6820e36071c071e0c3e1.tar.gz
rspamd-0b4c54e21874d6d622ab6820e36071c071e0c3e1.zip
[Feature] Allow parsing of mailbox messages from the commandline
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/protocol.c7
-rw-r--r--src/libserver/task.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 0ecc76ec6..5aff8f0cb 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -96,6 +96,7 @@
#define DELIVER_TO_HEADER "Deliver-To"
#define NO_LOG_HEADER "Log"
#define MLEN_HEADER "Message-Length"
+#define USER_AGENT_HEADER "User-Agent"
static GQuark
@@ -438,6 +439,12 @@ rspamd_protocol_handle_headers (struct rspamd_task *task,
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':
diff --git a/src/libserver/task.h b/src/libserver/task.h
index f436c8275..1d75e31dc 100644
--- a/src/libserver/task.h
+++ b/src/libserver/task.h
@@ -103,6 +103,7 @@ enum rspamd_task_stage {
#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))