From 533b9f676e2ff23a59cc3a622487c9c1a89bea2c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 29 Jul 2025 10:06:35 +0100 Subject: [PATCH] [Minor] Add --log-tag option for rspamc --- src/client/rspamc.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx index 04bbaeac85..1dc48faaec 100644 --- a/src/client/rspamc.cxx +++ b/src/client/rspamc.cxx @@ -92,6 +92,7 @@ static const char *pubkey = nullptr; static const char *user_agent = "rspamc"; static const char *files_list = nullptr; static const char *queue_id = nullptr; +static const char *log_tag = nullptr; static std::string settings; std::vector children; @@ -192,6 +193,8 @@ static GOptionEntry entries[] = "Read one or more newline separated filenames to scan from file", nullptr}, {"queue-id", '\0', 0, G_OPTION_ARG_STRING, &queue_id, "Set Queue-ID header for the request", nullptr}, + {"log-tag", '\0', 0, G_OPTION_ARG_STRING, &log_tag, + "Set Log-Tag header for the request", nullptr}, {"settings", '\0', 0, G_OPTION_ARG_CALLBACK, (void *) &rspamc_settings_callback, "Set Settings header as JSON/UCL for the request", nullptr}, {nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr}}; @@ -945,6 +948,10 @@ add_options(GQueue *opts) add_client_header(opts, "Queue-Id", queue_id); } + if (log_tag != nullptr) { + add_client_header(opts, "Log-Tag", log_tag); + } + if (!settings.empty()) { add_client_header(opts, "Settings", settings.c_str()); } -- 2.47.3