Added support for SQLite.
[exim.git] / src / src / verify.c
index e4b25beaf8fa3bc41a99c348a711dd62eabc115e..5852aa2939875c82a8f4cfcc3bd24a88c49be2e9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/verify.c,v 1.22 2005/06/27 14:29:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.24 2005/08/01 13:20:28 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -813,6 +813,8 @@ Arguments:
                        rewriting and messages from callouts
                      vopt_qualify => qualify an unqualified address; else error
                      vopt_expn => called from SMTP EXPN command
+                     vopt_success_on_redirect => when a new address is generated
+                       the verification instantly succeeds
 
                      These ones are used by do_callout() -- the options variable
                        is passed to it.
@@ -850,6 +852,7 @@ BOOL allok = TRUE;
 BOOL full_info = (f == NULL)? FALSE : (debug_selector != 0);
 BOOL is_recipient = (options & vopt_is_recipient) != 0;
 BOOL expn         = (options & vopt_expn) != 0;
+BOOL success_on_redirect = (options & vopt_success_on_redirect) != 0;
 int i;
 int yield = OK;
 int verify_type = expn? v_expn :
@@ -1219,9 +1222,12 @@ while (addr_new != NULL)
     generated address. */
 
     if (!full_info &&                    /* Stop if short info wanted AND */
-         (addr_new == NULL ||            /* No new address OR */
-          addr_new->next != NULL ||      /* More than one new address OR */
-          testflag(addr_new, af_pfr)))   /* New address is pfr */
+         (((addr_new == NULL ||          /* No new address OR */
+           addr_new->next != NULL ||     /* More than one new address OR */
+           testflag(addr_new, af_pfr)))  /* New address is pfr */
+         ||                              /* OR */
+         (addr_new != NULL &&            /* At least one new address AND */
+          success_on_redirect)))         /* success_on_redirect is set */
       {
       if (f != NULL) fprintf(f, "%s %s\n", address,
         address_test_mode? "is deliverable" : "verified");
@@ -1932,13 +1938,22 @@ if (iplookup)
   if (search_type < 0) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s",
     search_error_message);
 
-  /* Adjust parameters for the type of lookup. For a query-style
-  lookup, there is no file name, and the "key" is just the query. For
-  a single-key lookup, the key is the current IP address, masked
-  appropriately, and reconverted to text form, with the mask appended.
-  For IPv6 addresses, specify dot separators instead of colons. */
+  /* Adjust parameters for the type of lookup. For a query-style lookup, there
+  is no file name, and the "key" is just the query. For query-style with a file
+  name, we have to fish the file off the start of the query. For a single-key
+  lookup, the key is the current IP address, masked appropriately, and
+  reconverted to text form, with the mask appended. For IPv6 addresses, specify
+  dot separators instead of colons. */
 
-  if (mac_islookup(search_type, lookup_querystyle))
+  if (mac_islookup(search_type, lookup_absfilequery))
+    {
+    filename = semicolon + 1;
+    key = filename;
+    while (*key != 0 && !isspace(*key)) key++;
+    filename = string_copyn(filename, key - filename);
+    while (isspace(*key)) key++;
+    }
+  else if (mac_islookup(search_type, lookup_querystyle))
     {
     filename = NULL;
     key = semicolon + 1;
@@ -2041,7 +2056,7 @@ if ((semicolon = Ustrchr(ss, ';')) != NULL)
       search_error_message, ss);
     return DEFER;
     }
-  isquery = mac_islookup(id, lookup_querystyle);
+  isquery = mac_islookup(id, lookup_querystyle|lookup_absfilequery);
   }
 
 if (isquery)