ph10 2007/06/26 10:23:34 BST
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src match.c
exim-test/confs 0069
exim-test/scripts/0000-Basic 0069
exim-test/stderr 0069
exim-test/stdout 0069
Log:
Add +ignore_defer and +include_defer to host lists.
Revision Changes Path
1.518 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.153 +4 -0 exim/exim-doc/doc-txt/NewStuff
1.18 +48 -3 exim/exim-src/src/match.c
1.2 +14 -0 exim/exim-test/confs/0069
1.2 +16 -1 exim/exim-test/scripts/0000-Basic/0069
1.3 +63 -0 exim/exim-test/stderr/0069
1.2 +27 -0 exim/exim-test/stdout/0069
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.517
retrieving revision 1.518
diff -u -r1.517 -r1.518
--- ChangeLog 22 Jun 2007 14:38:58 -0000 1.517
+++ ChangeLog 26 Jun 2007 09:23:34 -0000 1.518
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.517 2007/06/22 14:38:58 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.518 2007/06/26 09:23:34 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -68,6 +68,8 @@
PH/10 Added the /noupdate option to the ratelimit ACL condition.
PH/11 Added $max_received_linelength.
+
+PH/12 Added +ignore_defer and +include_defer to host lists.
Exim version 4.67
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -r1.152 -r1.153
--- NewStuff 22 Jun 2007 14:38:58 -0000 1.152
+++ NewStuff 26 Jun 2007 09:23:34 -0000 1.153
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.152 2007/06/22 14:38:58 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.153 2007/06/26 09:23:34 ph10 Exp $
New Features in Exim
--------------------
@@ -77,6 +77,10 @@
6. The variable $max_received_linelength contains the number of bytes in the
longest line that was received as part of the message, not counting the
line termination character(s).
+
+ 7. Host lists can now include +ignore_defer and +include_defer, analagous to
+ +ignore_unknown and +include_unknown. These options should be used with
+ care, probably only in non-critical host lists such as whitelists.
Version 4.67
Index: match.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/match.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- match.c 8 Jan 2007 10:50:18 -0000 1.17
+++ match.c 26 Jun 2007 09:23:34 -0000 1.18
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/match.c,v 1.17 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/match.c,v 1.18 2007/06/26 09:23:34 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -444,6 +444,8 @@
unsigned int *original_cache_bits = *cache_ptr;
BOOL include_unknown = FALSE;
BOOL ignore_unknown = FALSE;
+BOOL include_defer = FALSE;
+BOOL ignore_defer = FALSE;
uschar *list;
uschar *sss;
uschar *ot = NULL;
@@ -553,10 +555,11 @@
}
}
- /* If the host item is "+include_unknown", remember it in case there's a
- subsequent failed reverse lookup. */
+ /* If the host item is "+include_unknown" or "+ignore_unknown", remember it
+ in case there's a subsequent failed reverse lookup. There is similar
+ processing for "defer". */
- else if (type == MCL_HOST)
+ else if (type == MCL_HOST && *ss == '+')
{
if (Ustrcmp(ss, "+include_unknown") == 0)
{
@@ -570,6 +573,18 @@
include_unknown = FALSE;
continue;
}
+ if (Ustrcmp(ss, "+include_defer") == 0)
+ {
+ include_defer = TRUE;
+ ignore_defer = FALSE;
+ continue;
+ }
+ if (Ustrcmp(ss, "+ignore_defer") == 0)
+ {
+ ignore_defer = TRUE;
+ include_defer = FALSE;
+ continue;
+ }
}
/* Starting with ! specifies a negative item. It is theoretically possible
@@ -724,6 +739,21 @@
return yield;
case DEFER:
+ if (error == NULL)
+ error = string_sprintf("DNS lookup of %s deferred", ss);
+ if (ignore_defer)
+ {
+ HDEBUG(D_lists) debug_printf("%s: item ignored by +ignore_defer\n",
+ error);
+ break;
+ }
+ HDEBUG(D_lists) debug_printf("%s %s (%s)\n", ot,
+ include_defer? "yes":"no", error);
+ if (include_defer)
+ {
+ log_write(0, LOG_MAIN, "%s: accepted by +include_defer", error);
+ return OK;
+ }
goto DEFER_RETURN;
/* The ERROR return occurs when checking hosts, when either a forward
@@ -823,7 +853,22 @@
return file_yield;
case DEFER:
+ if (error == NULL)
+ error = string_sprintf("DNS lookup of %s deferred", ss);
+ if (ignore_defer)
+ {
+ HDEBUG(D_lists) debug_printf("%s: item ignored by +ignore_defer\n",
+ error);
+ break;
+ }
(void)fclose(f);
+ HDEBUG(D_lists) debug_printf("%s %s (%s)\n", ot,
+ include_defer? "yes":"no", error);
+ if (include_defer)
+ {
+ log_write(0, LOG_MAIN, "%s: accepted by +include_defer", error);
+ return OK;
+ }
goto DEFER_RETURN;
case ERROR: /* host name lookup failed - this can only */
Index: 0069
===================================================================
RCS file: /home/cvs/exim/exim-test/confs/0069,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0069 7 Feb 2006 10:34:25 -0000 1.1
+++ 0069 26 Jun 2007 09:23:34 -0000 1.2
@@ -37,4 +37,18 @@
accept hosts = +ignore_unknown : non.existent.invalid : V4NET.0.0.13
deny message = "Denied"
+check_recipienta:
+ accept hosts = :
+ deny hosts = +include_defer : test.again.dns
+ accept domains = +local_domains
+ deny message = relay not permitted
+
+check_recipientb:
+ accept hosts = test.again.dns : V4NET.0.0.13
+ deny message = "Denied"
+
+check_recipientc:
+ accept hosts = +ignore_defer : test.again.dns : V4NET.0.0.13
+ deny message = "Denied"
+
# End
Index: 0069
===================================================================
RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0069,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0069 7 Feb 2006 10:54:33 -0000 1.1
+++ 0069 26 Jun 2007 09:23:34 -0000 1.2
@@ -1,4 +1,4 @@
-# +include_unknown and +ignore_unknown
+# +include_unknown, +ignore_unknown, +include_defer, +ignore_defer
exim -bh V4NET.0.0.1
mail from:<x@y>
rcpt to:<x@???>
@@ -22,5 +22,20 @@
exim -bh V4NET.0.0.13 -DLOG_SELECTOR=log_selector=+unknown_in_list
MAIL FROM:<userx@???>
rcpt to:<y@???>
+quit
+****
+exim -bh V4NET.0.0.13
+MAIL FROM:<userx>
+rcpt to:<a@???>
+quit
+****
+exim -bh V4NET.0.0.13
+MAIL FROM:<userx@???>
+rcpt to:<b@???>
+quit
+****
+exim -bh V4NET.0.0.13
+MAIL FROM:<userx@???>
+rcpt to:<c@???>
quit
****
Index: 0069
===================================================================
RCS file: /home/cvs/exim/exim-test/stderr/0069,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 0069 4 Apr 2006 14:02:31 -0000 1.2
+++ 0069 26 Jun 2007 09:23:34 -0000 1.3
@@ -113,3 +113,66 @@
>>> processing "deny"
>>> deny: condition test succeeded
LOG: H=[V4NET.0.0.13] F=<userx@???> rejected RCPT <y@???>: "Denied"
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> sender host name required, to match against ^ten-1\.test\.ex
+>>> looking up host name for V4NET.0.0.13
+LOG: no host name found for IP address V4NET.0.0.13
+>>> host in sender_unqualified_hosts? yes (failed to find host name for V4NET.0.0.13)
+LOG: failed to find host name for V4NET.0.0.13: accepted by +include_unknown
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> using ACL "check_recipienta"
+>>> processing "accept"
+>>> check hosts = :
+>>> host in ":"? no (end of list)
+>>> accept: condition test failed
+>>> processing "deny"
+>>> check hosts = +include_defer : test.again.dns
+>>> test.again.dns in dns_again_means_nonexist? no (option unset)
+>>> host in "+include_defer : test.again.dns"? yes (DNS lookup of test.again.dns deferred)
+LOG: DNS lookup of test.again.dns deferred: accepted by +include_defer
+>>> deny: condition test succeeded
+LOG: H=[V4NET.0.0.13] F=<userx@???> rejected RCPT <a@???>
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> sender host name required, to match against ^ten-1\.test\.ex
+>>> looking up host name for V4NET.0.0.13
+LOG: no host name found for IP address V4NET.0.0.13
+>>> host in sender_unqualified_hosts? yes (failed to find host name for V4NET.0.0.13)
+LOG: failed to find host name for V4NET.0.0.13: accepted by +include_unknown
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> using ACL "check_recipientb"
+>>> processing "accept"
+>>> check hosts = test.again.dns : V4NET.0.0.13
+>>> test.again.dns in dns_again_means_nonexist? no (option unset)
+>>> host in "test.again.dns : V4NET.0.0.13"? no (DNS lookup of test.again.dns deferred)
+>>> host in "test.again.dns : V4NET.0.0.13"? list match deferred for test.again.dns
+>>> accept: condition test deferred
+LOG: H=[V4NET.0.0.13] F=<userx@???> temporarily rejected RCPT <b@???>
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> sender host name required, to match against ^ten-1\.test\.ex
+>>> looking up host name for V4NET.0.0.13
+LOG: no host name found for IP address V4NET.0.0.13
+>>> host in sender_unqualified_hosts? yes (failed to find host name for V4NET.0.0.13)
+LOG: failed to find host name for V4NET.0.0.13: accepted by +include_unknown
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> using ACL "check_recipientc"
+>>> processing "accept"
+>>> check hosts = +ignore_defer : test.again.dns : V4NET.0.0.13
+>>> test.again.dns in dns_again_means_nonexist? no (option unset)
+>>> DNS lookup of test.again.dns deferred: item ignored by +ignore_defer
+>>> host in "+ignore_defer : test.again.dns : V4NET.0.0.13"? yes (matched "V4NET.0.0.13")
+>>> accept: condition test succeeded
Index: 0069
===================================================================
RCS file: /home/cvs/exim/exim-test/stdout/0069,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0069 7 Feb 2006 10:47:37 -0000 1.1
+++ 0069 26 Jun 2007 09:23:34 -0000 1.2
@@ -43,3 +43,30 @@
250 OK
550 "Denied"
221 myhost.test.ex closing connection
+
+**** SMTP testing session as if from host V4NET.0.0.13
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+550 Administrative prohibition
+221 myhost.test.ex closing connection
+
+**** SMTP testing session as if from host V4NET.0.0.13
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+451 Temporary local problem - please try later
+221 myhost.test.ex closing connection
+
+**** SMTP testing session as if from host V4NET.0.0.13
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+250 Accepted
+221 myhost.test.ex closing connection