aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_headers.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-19 17:29:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-19 17:29:31 +0100
commit2abae809e489587cfe319f92a21d7895492c4618 (patch)
treef289f7884dc022b8c982e3bcbad45434577e223b /src/libmime/mime_headers.c
parent13a13b60f155603393c5575ccfdeaa877cb613b6 (diff)
downloadrspamd-2abae809e489587cfe319f92a21d7895492c4618.tar.gz
rspamd-2abae809e489587cfe319f92a21d7895492c4618.zip
[Minor] Fix config-less tests
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r--src/libmime/mime_headers.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index 786d43a6a..fec23927e 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -44,6 +44,11 @@ rspamd_mime_header_check_special (struct rspamd_task *task,
struct rspamd_received_header *recv;
const gchar *p, *end;
gchar *id;
+ gint max_recipients = -1;
+
+ if (task->cfg) {
+ max_recipients = task->cfg->max_recipients;
+ }
h = rspamd_icase_hash (rh->name, strlen (rh->name), 0xdeadbabe);
@@ -63,25 +68,25 @@ rspamd_mime_header_check_special (struct rspamd_task *task,
case 0x76F31A09F4352521ULL: /* to */
MESSAGE_FIELD (task, rcpt_mime) = rspamd_email_address_from_mime (task->task_pool,
rh->decoded, strlen (rh->decoded),
- MESSAGE_FIELD (task, rcpt_mime), task->cfg->max_recipients);
+ MESSAGE_FIELD (task, rcpt_mime), max_recipients);
rh->flags |= RSPAMD_HEADER_TO|RSPAMD_HEADER_RCPT|RSPAMD_HEADER_UNIQUE;
break;
case 0x7EB117C1480B76ULL: /* cc */
MESSAGE_FIELD (task, rcpt_mime) = rspamd_email_address_from_mime (task->task_pool,
rh->decoded, strlen (rh->decoded),
- MESSAGE_FIELD (task, rcpt_mime), task->cfg->max_recipients);
+ MESSAGE_FIELD (task, rcpt_mime), max_recipients);
rh->flags |= RSPAMD_HEADER_CC|RSPAMD_HEADER_RCPT|RSPAMD_HEADER_UNIQUE;
break;
case 0xE4923E11C4989C8DULL: /* bcc */
MESSAGE_FIELD (task, rcpt_mime) = rspamd_email_address_from_mime (task->task_pool,
rh->decoded, strlen (rh->decoded),
- MESSAGE_FIELD (task, rcpt_mime), task->cfg->max_recipients);
+ MESSAGE_FIELD (task, rcpt_mime), max_recipients);
rh->flags |= RSPAMD_HEADER_BCC|RSPAMD_HEADER_RCPT|RSPAMD_HEADER_UNIQUE;
break;
case 0x41E1985EDC1CBDE4ULL: /* from */
MESSAGE_FIELD (task, from_mime) = rspamd_email_address_from_mime (task->task_pool,
rh->decoded, strlen (rh->decoded),
- MESSAGE_FIELD (task, from_mime), task->cfg->max_recipients);
+ MESSAGE_FIELD (task, from_mime), max_recipients);
rh->flags |= RSPAMD_HEADER_FROM|RSPAMD_HEADER_SENDER|RSPAMD_HEADER_UNIQUE;
break;
case 0x43A558FC7C240226ULL: /* message-id */ {