Skip to content

Commit a7800f1

Browse files
committed
mod_mailscript: Fix case-sensitive email address comparisons.
Compare MAIL FROM and RCPT TO for EQUALS and CONTAINS case-insensitively. Previously, if the case of these two headers differed, the rule would not match.
1 parent e465084 commit a7800f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/mod_mailscript.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ static int header_match(struct smtp_msg_process *mproc, const char *header, cons
212212
static void __attribute__ ((nonnull (2, 3, 4))) str_match(const char *matchtype, const char *a, const char *expr, int *restrict match)
213213
{
214214
if (!strcasecmp(matchtype, "EQUALS")) {
215-
*match = !strcmp(a, expr);
215+
*match = !strcasecmp(a, expr);
216216
} else if (!strcasecmp(matchtype, "CONTAINS")) {
217-
*match = strstr(a, expr) ? 1 : 0;
217+
*match = strcasestr(a, expr) ? 1 : 0;
218218
} else if (!strcasecmp(matchtype, "LIKE")) {
219219
regex_t regexbuf;
220220
int errcode;

0 commit comments

Comments
 (0)