From: Jeremy Harris Date: Mon, 1 Jul 2013 23:23:18 +0000 (+0100) Subject: Add test skeleton X-Git-Url: https://git.exim.org/users/jgh/exim.git/commitdiff_plain/dddd62bfa0611ba20ef8303f4fae6e8a8b424ec8?ds=inline;hp=-c Add test skeleton --- dddd62bfa0611ba20ef8303f4fae6e8a8b424ec8 diff --git a/src/src/deliver.c b/src/src/deliver.c index ce928abf3..ac120451b 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -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 diff --git a/src/src/exim.c b/src/src/exim.c index 1e4d6d646..3f5e0e153 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -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"); diff --git a/src/src/readconf.c b/src/src/readconf.c index d0608d7de..d59d2edeb 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -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 index 000000000..935d0adb2 --- /dev/null +++ b/test/confs/5700 @@ -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 index 000000000..933f2f64c --- /dev/null +++ b/test/log/5700 @@ -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 index 000000000..62c7dd24f --- /dev/null +++ b/test/scripts/5700-deliv-log/5700 @@ -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 index 000000000..338b5566e --- /dev/null +++ b/test/scripts/5700-deliv-log/REQUIRES @@ -0,0 +1 @@ +support Experimental_DBL diff --git a/test/stdout/5700 b/test/stdout/5700 new file mode 100644 index 000000000..fd8bd602a --- /dev/null +++ b/test/stdout/5700 @@ -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: +250 OK +RCPT TO: +250 OK +DATA +354 More... +Received: from CALLER by the.local.host.name with local (Exim x.yz) + (envelope-from ) + id 10HmaX-0005vi-00 + for userx@domain1; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Test message 1 +. +250 OK +QUIT +220 OK +End of script