return TRUE;
}
+void rspamd_message_process_injected_text_part(struct rspamd_task *task,
+ struct rspamd_mime_text_part *text_part,
+ uint16_t *cur_url_order)
+{
+ /* Process plain text (no HTML support for injected parts yet) */
+ if (!rspamd_message_process_plain_text_part(task, text_part)) {
+ return;
+ }
+
+ /* Normalize text */
+ rspamd_normalize_text_part(task, text_part);
+
+ /* Extract URLs - always use FIND_ALL for injected parts (plain text) */
+ rspamd_url_text_extract(task->task_pool, task, text_part, cur_url_order,
+ RSPAMD_URL_FIND_ALL);
+
+ /* Create words for Bayes/stats */
+ rspamd_mime_part_create_words(task, text_part);
+}
+
/* Creates message from various data using libmagic to detect type */
static void
rspamd_message_from_data(struct rspamd_task *task, const unsigned char *start,
*/
void rspamd_message_process(struct rspamd_task *task);
+/**
+ * Process an injected text part (URL extraction, words, normalization)
+ * @param task
+ * @param text_part the injected text part to process
+ * @param cur_url_order pointer to current URL order counter
+ */
+void rspamd_message_process_injected_text_part(struct rspamd_task *task,
+ struct rspamd_mime_text_part *text_part,
+ uint16_t *cur_url_order);
/**
* Converts string to cte
txt_part->raw.len = content_len;
txt_part->parsed = txt_part->raw;
txt_part->utf_content = txt_part->raw;
+ txt_part->utf_stripped_text = (UText) UTEXT_INITIALIZER;
txt_part->real_charset = "utf-8";
/* Add to message */
g_ptr_array_add(task->message->parts, part);
g_ptr_array_add(task->message->text_parts, txt_part);
+ /* Process injected text part fully (URLs, words, normalization) */
+ if (task->cfg && task->message) {
+ /* Use high order number to ensure injected URLs are after original ones */
+ uint16_t cur_url_order = 10000;
+ rspamd_message_process_injected_text_part(task, txt_part, &cur_url_order);
+ }
+
lua_pushboolean(L, true);
}
else {