Skip to content

Commit

Permalink
mod_mailscript: Fix case-sensitive email address comparisons.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
InterLinked1 committed Feb 14, 2025
1 parent e465084 commit a7800f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/mod_mailscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ static int header_match(struct smtp_msg_process *mproc, const char *header, cons
static void __attribute__ ((nonnull (2, 3, 4))) str_match(const char *matchtype, const char *a, const char *expr, int *restrict match)
{
if (!strcasecmp(matchtype, "EQUALS")) {
*match = !strcmp(a, expr);
*match = !strcasecmp(a, expr);
} else if (!strcasecmp(matchtype, "CONTAINS")) {
*match = strstr(a, expr) ? 1 : 0;
*match = strcasestr(a, expr) ? 1 : 0;
} else if (!strcasecmp(matchtype, "LIKE")) {
regex_t regexbuf;
int errcode;
Expand Down

0 comments on commit a7800f1

Please sign in to comment.