Testsuite: add dnsdb testcase for defer when used in ACL
[exim.git] / src / src / acl.c
index 64b310968cf93adc8f24b4ec291247d9aad405b3..396e29965af3157e44107f0a08d7b736c4d1f04e 100644 (file)
@@ -2838,18 +2838,15 @@ for (; cb != NULL; cb = cb->next)
   of them, but not for all, because expansion happens down in some lower level
   checking functions in some cases. */
 
-  if (conditions[cb->type].expand_at_top)
+  if (!conditions[cb->type].expand_at_top)
+    arg = cb->arg;
+  else if (!(arg = expand_string(cb->arg)))
     {
-    arg = expand_string(cb->arg);
-    if (arg == NULL)
-      {
-      if (expand_string_forcedfail) continue;
-      *log_msgptr = string_sprintf("failed to expand ACL string \"%s\": %s",
-        cb->arg, expand_string_message);
-      return search_find_defer? DEFER : ERROR;
-      }
+    if (expand_string_forcedfail) continue;
+    *log_msgptr = string_sprintf("failed to expand ACL string \"%s\": %s",
+      cb->arg, expand_string_message);
+    return search_find_defer ? DEFER : ERROR;
     }
-  else arg = cb->arg;
 
   /* Show condition, and expanded condition if it's different */