result->type = RSPAMD_RE_HEADER;
p++;
break;
+ case 'R':
+ result->type = RSPAMD_RE_RAWHEADER;
+ p++;
+ break;
+ case 'B':
+ result->type = RSPAMD_RE_MIMEHEADER;
+ p++;
+ break;
case 'M':
result->type = RSPAMD_RE_BODY;
p++;
result->type = RSPAMD_RE_RAWHEADER;
p++;
break;
+ /* Other flags */
case 'T':
result->is_test = TRUE;
p++;
return NULL;
}
+ if ((result->type == RSPAMD_RE_HEADER ||
+ result->type == RSPAMD_RE_RAWHEADER ||
+ result->type == RSPAMD_RE_MIMEHEADER) &&
+ result->header == NULL) {
+ msg_err_pool ("header regexp: '%s' has no header part", src);
+ return NULL;
+ }
+
+
result->regexp_text = rspamd_mempool_strdup (pool, start);
dbegin = result->regexp_text + (begin - start);
dend = result->regexp_text + (end - start);