]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/routers/redirect.c
pcre2
[user/henk/code/exim.git] / src / src / routers / redirect.c
index cd225d8e91f59e44b73c7df5fecabd8a75d62856..71769dbc3386a9b19f522f7b85dcfb0f8f14543d 100644 (file)
@@ -93,7 +93,7 @@ optionlist redirect_router_options[] = {
   { "sieve_useraddress", opt_stringptr,                LOFF(sieve_useraddress) },
   { "sieve_vacation_directory", opt_stringptr, LOFF(sieve_vacation_directory) },
   { "skip_syntax_errors", opt_bool,            LOFF(skip_syntax_errors) },
-#ifdef EXPERIMENTAL_SRS
+#ifdef EXPERIMENTAL_SRS_ALT
   { "srs",                opt_stringptr,       LOFF(srs) },
   { "srs_alias",          opt_stringptr,       LOFF(srs_alias) },
   { "srs_condition",      opt_stringptr,       LOFF(srs_condition) },
@@ -149,7 +149,7 @@ redirect_router_options_block redirect_router_option_defaults = {
   NULL,        /* qualify_domain */
   NULL,        /* owners */
   NULL,        /* owngroups */
-#ifdef EXPERIMENTAL_SRS
+#ifdef EXPERIMENTAL_SRS_ALT
   NULL,        /* srs */
   NULL,        /* srs_alias */
   NULL,        /* srs_condition */
@@ -529,9 +529,6 @@ int options = ob->bit_options;
 int frc = 0;
 int xrc = 0;
 
-addr_local = addr_local;     /* Keep picky compilers happy */
-addr_remote = addr_remote;
-
 /* Initialize the data to be propagated to the children */
 
 addr_prop.address_data = deliver_address_data;
@@ -543,7 +540,7 @@ addr_prop.remove_headers = NULL;
 addr_prop.variables = NULL;
 tree_dup((tree_node **)&addr_prop.variables, addr->prop.variables);
 
-#ifdef EXPERIMENTAL_SRS
+#ifdef EXPERIMENTAL_SRS_ALT
 addr_prop.srs_sender = NULL;
 #endif
 #ifdef SUPPORT_I18N
@@ -578,7 +575,7 @@ if (!ugid.gid_set && pw != NULL)
   ugid.gid_set = TRUE;
   }
 
-#ifdef EXPERIMENTAL_SRS
+#ifdef EXPERIMENTAL_SRS_ALT
   /* Perform SRS on recipient/return-path as required  */
 
   if(ob->srs != NULL)
@@ -737,15 +734,13 @@ switch (frc)
       addr->message = yield == FAIL ? US"forced rejection" : US"forced defer";
     else
       {
-      int ovector[3];
-      if (ob->forbid_smtp_code &&
-         pcre_exec(regex_smtp_code, NULL, CS addr->message,
-           Ustrlen(addr->message), 0, PCRE_EOPT,
-           ovector, sizeof(ovector)/sizeof(int)) >= 0)
+      uschar * matched;
+      if (  ob->forbid_smtp_code
+        && regex_match(regex_smtp_code, addr->message, -1, &matched))
        {
        DEBUG(D_route) debug_printf("SMTP code at start of error message "
          "is ignored because forbid_smtp_code is set\n");
-       addr->message += ovector[1];
+       addr->message += Ustrlen(matched);
        }
       addr->user_message = addr->message;
       setflag(addr, af_pass_message);