Can remove the sender and/or the recipient from the key of the greylister.
[apps/pfixtools.git] / postlicyd / filter.c
index 14bfc9b..e108b25 100644 (file)
@@ -281,6 +281,7 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len,
                      const char *value, int value_len)
 {
     filter_hook_t hook;
+    hook.filter_id = -1;
     hook.type  = hook_tokenize(name, name_len);
     if (hook.type == HTK_UNKNOWN) {
         err("unknown hook type %.*s", name_len, name);
@@ -295,6 +296,7 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len,
 
     /* Value format is (counter:id:incr)?(postfix:reply|filter_name)
      */
+    hook.value = NULL;
     if (strncmp(value, "counter:", 8) == 0) {
         char *end = NULL;
         value += 8;
@@ -327,7 +329,6 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len,
         return false;
     }
     hook.value = m_strdup(hook.postfix ? value + 8 : value);
-    hook.filter_id = -1;
     array_add(filter->hooks, hook);
     return true;
 }