summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Finch <dot@dot.at>2008-09-05 16:59:47 +0000
committerTony Finch <dot@dot.at>2008-09-05 16:59:47 +0000
commite276e04bb6468a6b9f5d0f67cc84b1921c6020d9 (patch)
tree135c47c218db9be94c41d895cea120d13fe99f6d
parent7199e1ee2c175060f708ff91ccaf992b5afdbaa9 (diff)
Produce a more useful error message if an SMTP transport's hosts
setting expands to an empty string. Bug reported by Jens Hoffrichter <jens.hoffrichter@gmail.com>
-rw-r--r--doc/doc-txt/ChangeLog5
-rw-r--r--src/src/transports/smtp.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index f6a992246..c6fd500ec 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.552 2008/09/03 18:53:29 fanf2 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.553 2008/09/05 16:59:47 fanf2 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -65,6 +65,9 @@ TF/07 Fix the way ${extract is skipped in the untaken branch of a conditional.
TF/08 TLS error reporting now respects the incoming_interface and
incoming_port log selectors.
+TF/09 Produce a more useful error message if an SMTP transport's hosts
+ setting expands to an empty string.
+
Exim version 4.69
-----------------
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 4e1f3c45b..e8354ad7a 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/transports/smtp.c,v 1.39 2008/03/05 21:13:23 tom Exp $ */
+/* $Cambridge: exim/src/src/transports/smtp.c,v 1.40 2008/09/05 16:59:48 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2264,6 +2264,15 @@ if (hostlist == NULL || (ob->hosts_override && ob->hosts != NULL))
host_build_hostlist(&hostlist, s, ob->hosts_randomize);
+ /* Check that the expansion yielded something useful. */
+ if (hostlist == NULL)
+ {
+ addrlist->message =
+ string_sprintf("%s transport has empty hosts setting", tblock->name);
+ addrlist->transport_return = PANIC;
+ return FALSE; /* Only top address has status */
+ }
+
/* If there was no expansion of hosts, save the host list for
next time. */