Hi!
This is a simple patch to qregex.c for ignoring case in matches.
matchregex() is used in qmail-smtpd.c in function bmcheck() to check for
bad mail from addresss and in qmail-queue.c in function tapcheck() to
match mail addresses (from Inter7's qmail-tap patch).
As email addresses are case insensitive (at least on qmail systems) this
patch allows to have simpler regular expressions.
--- qmail-1.03/qregex.c 2006-02-20 13:41:12.000000000 +0100
+++ qmail-1.03-tap/qregex.c 2006-12-11 12:13:40.042976507 +0100
@@ -26,7 +26,7 @@
#include <regex.h>
#include "qregex.h"
-#define REGCOMP(X,Y) regcomp(&X, Y, REG_EXTENDED)
+#define REGCOMP(X,Y) regcomp(&X, Y, REG_EXTENDED | REG_ICASE)
#define REGEXEC(X,Y) regexec(&X, Y, (size_t)0, (regmatch_t *)0, (int)0)
int matchregex(char *text, char *regex) {
Greetings
--
Robert Sander Senior Manager Information Systems
Epigenomics AG Kleine Praesidentenstr. 1 10178 Berlin, Germany
phone:+49-30-24345-0 fax:+49-30-24345-555
http://www.epigenomics.com robert.sander@epigenomics.com
|