- pcre_list *re_list_head = NULL;
- FILE *f;
- uschar *mime_subject = NULL;
- int mime_subject_len = 0;
- int ret;
-
- /* reset expansion variable */
- regex_match_string = NULL;
-
- /* precompile our regexes */
- if (!(re_list_head = compile(*listptr)))
- return FAIL; /* no regexes -> nothing to do */
-
- /* check if the file is already decoded */
- if (mime_decoded_filename == NULL) {
- const uschar *empty = US"";
- /* no, decode it first */
- mime_decode(&empty);
- if (mime_decoded_filename == NULL) {
- /* decoding failed */
- log_write(0, LOG_MAIN,
- "mime_regex acl condition warning - could not decode MIME part to file.");
- return DEFER;
+pcre_list * re_list_head = NULL;
+FILE * f;
+uschar * mime_subject = NULL;
+int mime_subject_len = 0;
+int ret = FAIL;
+rmark reset_point;
+
+regex_vars_clear();
+
+/* check if the file is already decoded */
+if (!mime_decoded_filename)
+ { /* no, decode it first */
+ const uschar *empty = US"";
+ mime_decode(&empty);
+ if (!mime_decoded_filename)
+ { /* decoding failed */
+ log_write(0, LOG_MAIN,
+ "mime_regex acl condition warning - could not decode MIME part to file");
+ return DEFER;