diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-08-07 14:27:49 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-07 14:27:49 +0600 |
commit | dc808aac88771bb6f95571a7ac102e853b9c45a8 (patch) | |
tree | 192b044de37f52ed2ef50638922b42d4ed155e13 /src/libserver/protocol.c | |
parent | 6a97bdd201686503654a434fd2624db89657aaa1 (diff) | |
parent | 406f694d893c3d4e1617b66cdf87bc22a1b1beb7 (diff) | |
download | rspamd-dc808aac88771bb6f95571a7ac102e853b9c45a8.tar.gz rspamd-dc808aac88771bb6f95571a7ac102e853b9c45a8.zip |
Merge branch 'master' into master
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r-- | src/libserver/protocol.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index db83b0bfb..ee2192913 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -660,9 +660,9 @@ rspamd_protocol_handle_headers(struct rspamd_task *task, IF_HEADER(USER_HEADER) { /* - * We must ignore User header in case of spamc, as SA has - * different meaning of this header - */ + * We must ignore User header in case of spamc, as SA has + * different meaning of this header + */ msg_debug_protocol("read user header, value: %T", hv_tok); if (!RSPAMD_TASK_IS_SPAMC(task)) { task->auth_user = rspamd_mempool_ftokdup(task->task_pool, @@ -708,6 +708,15 @@ rspamd_protocol_handle_headers(struct rspamd_task *task, task->flags |= RSPAMD_TASK_FLAG_NO_LOG; } } + IF_HEADER(LOG_TAG_HEADER) + { + msg_debug_protocol("read log-tag header, value: %T", hv_tok); + /* Ensure that a tag is valid */ + if (rspamd_fast_utf8_validate(hv_tok->begin, hv_tok->len) == 0) { + memcpy(task->task_pool->tag.uid, hv_tok->begin, + MIN(hv_tok->len, sizeof(task->task_pool->tag.uid))); + } + } break; case 'm': case 'M': @@ -752,9 +761,9 @@ rspamd_protocol_handle_headers(struct rspamd_task *task, default: msg_debug_protocol("generic header: %T", hn_tok); break; - } + } - rspamd_task_add_request_header (task, hn_tok, hv_tok); + rspamd_task_add_request_header (task, hn_tok, hv_tok); } }); /* End of kh_foreach_value */ |