From: Vsevolod Stakhov Date: Fri, 18 Jun 2021 12:38:21 +0000 (+0100) Subject: [Feature] Strip smtp comments from message id X-Git-Tag: 3.0~280 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca04d2496d83ba59100e0ab93f7f7a7479322d3a;p=rspamd.git [Feature] Strip smtp comments from message id --- diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 0bca94024..71b4f2688 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -44,7 +44,7 @@ rspamd_mime_header_check_special (struct rspamd_task *task, struct rspamd_received_header *recv; const gchar *p, *end; gchar *id; - gint max_recipients = -1; + gint max_recipients = -1, len; if (task->cfg) { max_recipients = task->cfg->max_recipients; @@ -93,7 +93,9 @@ rspamd_mime_header_check_special (struct rspamd_task *task, rh->flags = RSPAMD_HEADER_MESSAGE_ID|RSPAMD_HEADER_UNIQUE; p = rh->decoded; - end = p + strlen (p); + len = rspamd_strip_smtp_comments_inplace(rh->decoded, strlen(p)); + rh->decoded[len] = '\0'; /* Zero terminate after stripping */ + end = p + len; if (*p == '<') { p++;