+/* check whether value for $dsn_return would be valid */
+static int check_dsn_return (const char* val) {
+ if (val && *val && str_ncmp (val, "hdrs", 4) != 0 &&
+ str_ncmp (val, "full", 4) != 0)
+ return (0);
+ return (1);
+}
+
+/* check whether value for $dsn_notify would be valid */
+static int check_dsn_notify (const char* val) {
+ list2_t* list = NULL;
+ int i = 0, rc = 1;
+
+ if (!val || !*val)
+ return (1);
+ list = list_from_str (val, ",");
+ if (list_empty (list))
+ return (1);
+
+ for (i = 0; i < list->length; i++)
+ if (str_ncmp (list->data[i], "never", 5) != 0 &&
+ str_ncmp (list->data[i], "failure", 7) != 0 &&
+ str_ncmp (list->data[i], "delay", 5) != 0 &&
+ str_ncmp (list->data[i], "success", 7) != 0) {
+ rc = 0;
+ break;
+ }
+ list_del (&list, (list_del_t*) _mem_free);
+ return (rc);
+}
+
+static int check_special (const char* name, const char* val) {
+ int i = 0;
+
+ for (i = 0; SpecialVars[i].name; i++) {
+ if (str_cmp (SpecialVars[i].name, name) == 0)
+ return (SpecialVars[i].check (val));
+ }
+ return (1);
+}
+