return 0;
}
+static int remove_from_spam_list (SPAM_LIST **list, const char *pat);
static int add_to_spam_list (SPAM_LIST **list, const char *pat, const char *templ, BUFFER *err)
{
else
++p;
}
- t->nmatch++; /* match 0 is always the whole expr */
+
+ if (t->nmatch > t->rx->rx->re_nsub)
+ {
+ snprintf (err->data, err->dsize, _("Not enough subexpressions for spam "
+ "template"));
+ remove_from_spam_list(list, pat);
+ return -1;
+ }
+
+ t->nmatch++; /* match 0 is always the whole expr */
return 0;
}