Add test skeleton
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 1 Jul 2013 23:23:18 +0000 (00:23 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 1 Jul 2013 23:23:18 +0000 (00:23 +0100)
src/src/deliver.c
src/src/exim.c
src/src/readconf.c
test/confs/5700 [new file with mode: 0644]
test/log/5700 [new file with mode: 0644]
test/scripts/5700-deliv-log/5700 [new file with mode: 0644]
test/scripts/5700-deliv-log/REQUIRES [new file with mode: 0644]
test/stdout/5700 [new file with mode: 0644]

index ce928abf34b15a911e4779fd4e8528a215c65048..ac120451bd2681baaaf9e09fbd18b9e7a97c9810 100644 (file)
@@ -695,6 +695,10 @@ the log line, and reset the store afterwards. Remote deliveries should always
 have a pointer to the host item that succeeded; local deliveries can have a
 pointer to a single host item in their host list, for use by the transport. */
 
+#ifdef EXPERIMENTAL_DBL
+  dbl_delivery_ip = NULL;      /* presume no successful remote delivery */
+#endif
+
 s = reset_point = store_get(size);
 
 log_address = string_log_address(addr, (log_write_selector & L_all_parents) != 0, TRUE);
@@ -713,9 +717,6 @@ if ((log_extra_selector & LX_sender_on_delivery) != 0  ||  msg)
 if(addr->p.srs_sender)
   s = string_append(s, &size, &ptr, 3, US" SRS=<", addr->p.srs_sender, US">");
 #endif
-#ifdef EXPERIMENTAL_DBL
-  dbl_delivery_ip = NULL;      /* presume no successful remote delivery */
-#endif
 
 /* You might think that the return path must always be set for a successful
 delivery; indeed, I did for some time, until this statement crashed. The case
index 1e4d6d64611fde419c9045503c34bed52576bafe..3f5e0e15321115485726e4de1fba293e303dcae4 100644 (file)
@@ -826,7 +826,7 @@ fprintf(f, "Support for:");
   fprintf(f, " Experimental_PRDR");
 #endif
 #ifdef EXPERIMENTAL_DBL
-  fprintf(f, " EXPERIMENTAL_DBL");
+  fprintf(f, " Experimental_DBL");
 #endif
 fprintf(f, "\n");
 
index d0608d7dee8d94f0f44f306b8f4c95c977dcea96..d59d2edebcefd72af94b90bb28dd264bc41009bf 100644 (file)
@@ -3989,12 +3989,14 @@ uschar *p;
 
 /* Not receiving messages, don't need to parse the ACL data */
 
+#ifndef EXPERIMENTAL_DBL
 if (skip)
   {
   DEBUG(D_acl) debug_printf("skipping ACL configuration - not needed\n");
   while ((p = get_config_line()) != NULL);
   return;
   }
+#endif
 
 /* Read each ACL and add it into the tree. Macro (re)definitions are allowed
 between ACLs. */
diff --git a/test/confs/5700 b/test/confs/5700
new file mode 100644 (file)
index 0000000..935d0ad
--- /dev/null
@@ -0,0 +1,58 @@
+# Exim test configuration 5700
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+rfc1413_query_timeout = 0s
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = accept
+acl_smtp_data = accept
+
+dbl_delivery_query = ${acl {a_logger}}
+
+
+# ----- ACL -----
+
+begin acl
+
+a_logger:
+    require logwrite = \
+           A \
+           1 <$dbl_delivery_ip> \
+           2 <$dbl_delivery_port> \
+           3 <$dbl_delivery_fqdn> \
+           4 <$dbl_delivery_local_part> \
+           5 <$dbl_delivery_domain> \
+           6 <$dbl_delivery_confirmation> \
+           7 <$dbl_defer_errno> \
+           8 <$dbl_defer_errstr> \
+           9 <$router_name> \
+           10 <$transport_name>
+
+
+# ----- Routers -----
+
+begin routers
+
+others:
+  driver = manualroute
+  route_list = domain1 127.0.0.1 byname
+  self = send
+  transport = smtp
+  no_more
+
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+  driver = smtp
+  port = PORT_S
+
+# End
diff --git a/test/log/5700 b/test/log/5700
new file mode 100644 (file)
index 0000000..933f2f6
--- /dev/null
@@ -0,0 +1,6 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local S=sss
+1999-03-02 09:44:33 Start queue run: pid=pppp -qqf
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@domain1 R=others T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 A 1 127.0.0.1 2 1224 3 127.0.0.1 4 userx 5 domain1 6 250 OK 7 0 8  9  10 
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 End queue run: pid=pppp -qqf
diff --git a/test/scripts/5700-deliv-log/5700 b/test/scripts/5700-deliv-log/5700
new file mode 100644 (file)
index 0000000..62c7dd2
--- /dev/null
@@ -0,0 +1,26 @@
+# Arbtirary expansion after transport
+# (EXPERIMENTAL_BDL - database logging)
+#
+need_ipv4
+#
+exim -odq userx@domain1
+Test message 1
+****
+server PORT_S
+220 ESMTP
+EHLO
+250-OK
+250 HELP
+MAIL
+250 OK
+RCPT
+250 OK
+DATA
+354 More...
+.
+250 OK
+QUIT
+220 OK
+****
+exim -d+deliver+expand+acl -qqf
+****
diff --git a/test/scripts/5700-deliv-log/REQUIRES b/test/scripts/5700-deliv-log/REQUIRES
new file mode 100644 (file)
index 0000000..338b556
--- /dev/null
@@ -0,0 +1 @@
+support Experimental_DBL
diff --git a/test/stdout/5700 b/test/stdout/5700
new file mode 100644 (file)
index 0000000..fd8bd60
--- /dev/null
@@ -0,0 +1,28 @@
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+220 ESMTP
+EHLO the.local.host.name
+250-OK
+250 HELP
+MAIL FROM:<CALLER@the.local.host.name>
+250 OK
+RCPT TO:<userx@domain1>
+250 OK
+DATA
+354 More...
+Received: from CALLER by the.local.host.name with local (Exim x.yz)
+       (envelope-from <CALLER@the.local.host.name>)
+       id 10HmaX-0005vi-00
+       for userx@domain1; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaX-0005vi-00@the.local.host.name>
+From: CALLER_NAME <CALLER@the.local.host.name>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+Test message 1
+.
+250 OK
+QUIT
+220 OK
+End of script