diff src/context.h @ 233:5c3e9bf45bb5 stable-6-0-23

Add whitelisting by regex expression filtering. Add queueid to whitelist extension log message.
author Carl Byington <carl@five-ten-sg.com>
date Mon, 25 May 2009 11:14:32 -0700
parents 82886d4dd71f
children d8ee4c97b9ab
line wrap: on
line diff
--- a/src/context.h	Fri May 08 15:21:40 2009 -0700
+++ b/src/context.h	Mon May 25 11:14:32 2009 -0700
@@ -135,6 +135,8 @@
     const char *    generic_regx;       // pointer to generic regular expression
     const char *    generic_message;    // pointer to generic message with one %s
     regex_t         generic_pattern;    // compiled regex pattern
+    const char *    white_regx;         // pointer to whitelist regular expression
+    regex_t         white_pattern;      // compiled regex pattern
     const char *    autowhite_file;     // file to use for automatic whitelisting
     WHITELISTERP    whitelister;        // pointer to the auto whitelister structure
     string_map      env_from;           // map senders to white/black/unknown
@@ -193,7 +195,7 @@
     void        add_from(const char *from, const char *status)    {env_from[from] = status;};
     void        add_from_context(const char *from, CONTEXTP con)  {env_from_context[from] = con;};
     void        set_from_default(const char *status)              {env_from_default = status;};
-    const char* find_from(const char *from, bool update_white = false);
+    const char* find_from(const char *from, bool update_white = false, const char *queueid = NULL);
     CONTEXTP    find_context(const char *from);
     CONTEXTP    find_from_context_name(const char *name);
 
@@ -218,6 +220,9 @@
     void        add_dnsbl(DNSBLP dns)                       {dnsbl_list.push_back(dns);};
     DNSBLP      find_dnsbl(const char *name);
 
+    bool        set_white(const char *regx);
+    bool        white_match(const char *from);
+
     bool        set_generic(const char *regx, const char *msg);
     const char* generic_match(const char *client);
 
@@ -312,6 +317,7 @@
 extern const char *token_uribl;
 extern const char *token_verify;
 extern const char *token_white;
+extern const char *token_white_regex;
 extern const char *token_yes;
 
 extern pthread_mutex_t verifier_mutex;     // protect the verifier map