summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-05-10 23:13:41 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-05-11 00:37:24 +0100
commit8241d8dda54bd5680b6fd8ef16108c0309a5ade7 (patch)
tree03514818515fe991a48b6c55799866996f4dbc12
parent99a0dc9358699cbe049cdd97874b17c263174f86 (diff)
Do not use the A lookup following an AAAA for setting the FQDN. Bug 1588
Normally benign, it bites when the pair was led to by a CNAME; modern usage is to not canoicalize the domain to a cname target (and we were inconsistent anyway for A-only vs AAAA+A).
-rw-r--r--doc/doc-txt/ChangeLog5
-rw-r--r--src/src/host.c5
-rw-r--r--test/confs/060741
-rw-r--r--test/dnszones-src/db.test.ex6
-rw-r--r--test/log/060714
-rw-r--r--test/scripts/0000-Basic/060732
6 files changed, 102 insertions, 1 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 4e6b9783b..e7693c38d 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -96,6 +96,11 @@ JH/26 Bug 1539: Add timout/retry options on dnsdb lookups.
JH/27 Bug 286: Support SOA lookup in dnsdb lookups.
+JH/28 Bug 1588: Do not use the A lookup following an AAAA for setting the FQDN.
+ Normally benign, it bites when the pair was led to by a CNAME;
+ modern usage is to not canoicalize the domain to a CNAME target
+ (and we were inconsistent anyway for A-only vs AAAA+A).
+
Exim version 4.85
-----------------
diff --git a/src/src/host.c b/src/src/host.c
index 45ec13659..206751757 100644
--- a/src/src/host.c
+++ b/src/src/host.c
@@ -2380,7 +2380,10 @@ for (; i >= 0; i--)
/* Lookup succeeded: fill in the given host item with the first non-ignored
address found; create additional items for any others. A single A6 record
- may generate more than one address. */
+ may generate more than one address. The lookup had a chance to update the
+ fqdn; we do not want any later times round the loop to do so. */
+
+ fully_qualified_name = NULL;
for (rr = dns_next_rr(&dnsa, &dnss, RESET_ANSWERS);
rr != NULL;
diff --git a/test/confs/0607 b/test/confs/0607
new file mode 100644
index 000000000..af4d238b5
--- /dev/null
+++ b/test/confs/0607
@@ -0,0 +1,41 @@
+# Exim test configuration 0607
+
+SERVER =
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/SERVER%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+log_selector = +received_recipients +sender_on_delivery
+
+acl_smtp_rcpt = accept
+queue_only
+queue_run_in_order
+
+#---------------
+
+begin routers
+
+dump:
+ driver = redirect
+ condition = ${if eq {SERVER}{server}{yes}{no}}
+ data = :blackhole:
+
+all:
+ driver = dnslookup
+ self = send
+ transport = out
+
+#---------------
+
+begin transports
+
+out:
+ driver = smtp
+ port = PORT_D
+
+# End
+
diff --git a/test/dnszones-src/db.test.ex b/test/dnszones-src/db.test.ex
index c9b004c76..05deca5d3 100644
--- a/test/dnszones-src/db.test.ex
+++ b/test/dnszones-src/db.test.ex
@@ -155,6 +155,12 @@ testsub.sub A V4NET.99.0.3
recurse.test.ex A V4NET.99.0.2
+; a CNAME pointing to a name with both ipv4 and ipv6 A-records
+; and one with only ipv4
+
+cname46 CNAME localhost
+cname4 CNAME thishost
+
; -------- Testing RBL records -------
; V4NET.11.12.13 is deliberately not reverse-registered
diff --git a/test/log/0607 b/test/log/0607
new file mode 100644
index 000000000..049238256
--- /dev/null
+++ b/test/log/0607
@@ -0,0 +1,14 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss for testx@cname46.test.ex
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local-smtp S=sss for testx@cname4.test.ex
+1999-03-02 09:44:33 Start queue run: pid=pppp -qq
+1999-03-02 09:44:33 10HmaX-0005vi-00 => testx@cname46.test.ex F=<CALLER@the.local.host.name> R=all T=out H=localhost.test.ex [::1] C="250 OK id=10HmaZ-0005vi-00"
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaY-0005vi-00 => testx@cname4.test.ex F=<CALLER@the.local.host.name> R=all T=out H=thishost.test.ex [127.0.0.1] C="250 OK id=10HmbA-0005vi-00"
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 End queue run: pid=pppp -qq
+
+******** SERVER ********
+1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4)
+1999-03-02 09:44:33 no host name found for IP address ::1
+1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@the.local.host.name H=(the.local.host.name) [::1] P=esmtp S=sss id=E10HmaX-0005vi-00@the.local.host.name for testx@cname46.test.ex
+1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@the.local.host.name H=localhost (the.local.host.name) [127.0.0.1] P=esmtp S=sss id=E10HmaY-0005vi-00@the.local.host.name for testx@cname4.test.ex
diff --git a/test/scripts/0000-Basic/0607 b/test/scripts/0000-Basic/0607
new file mode 100644
index 000000000..83c83b312
--- /dev/null
+++ b/test/scripts/0000-Basic/0607
@@ -0,0 +1,32 @@
+# delivery to cname
+# Exim test configuration 0607
+#
+need_ipv6
+#
+exim -DSERVER=server -bd -oX PORT_D
+****
+#
+exim -bs
+MAIL FROM:<CALLER@myhost.test.ex>
+RCPT TO: <testx@cname46.test.ex>
+DATA
+Subject: test
+
+foo
+.
+RSET
+MAIL FROM:<CALLER@myhost.test.ex>
+RCPT TO: <testx@cname4.test.ex>
+DATA
+Subject: test
+
+foo
+.
+QUIT
+****
+#
+exim -qq
+****
+#
+killdaemon
+no_msglog_check