procmail
[Top] [All Lists]

COND_MATCH Environment Variable Patch

2002-10-23 13:13:27
Hi,

Since I didn't see any obvious way to do this, I made up a small patch
to set the environment variable COND_MATCH to the condition that was
matched.

I'd love any comments on the patch.  This is against v3.22.

Thanks,

Todd

--- misc.c.orig Thu Jun 28 22:21:05 2001
+++ misc.c      Wed Oct 23 10:58:33 2002
@@ -641,6 +641,7 @@
               elog(" !");
            logqnl(buf2);
          }
+        set_cond_match(buf2);
 skiptrue:;
        }
     }

--- variables.c.orig    Wed Oct 23 10:59:08 2002
+++ variables.c Wed Oct 23 10:54:32 2002
@@ -461,3 +461,14 @@
       }
   return t;
 }
+
+void set_cond_match(char *s)
+{
+       char *q;
+       unsigned int len = strlen(s);
+
+       yell("Condition matched: ", s);
+
+       primeStdout("COND_MATCH=");q=realloc(Stdout,(Stdfilled+=len)+1);
+       tmemmove(q+Stdfilled-(int)len,s,len);retbStdout(q);
+}


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • COND_MATCH Environment Variable Patch, Todd Goodman <=