diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 390463fe3a..dd22f6bb9c 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -581,7 +581,7 @@ class messenger */ function get_transport($dummy = false) { - if ($dummy) + if ($dummy || empty($this->config['smtp_host'])) { $dsn = 'null://null'; } @@ -600,7 +600,7 @@ class messenger $transport = Transport::fromDsn($dsn); - if ($this->config['smtp_delivery']) + if ($this->config['smtp_delivery'] && $dsn != 'null://null') { // Set ssl context options, see http://php.net/manual/en/context.ssl.php $verify_peer = (bool) $this->config['smtp_verify_peer']; diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 2ce670d390..ddfca1e0be 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -418,7 +418,7 @@ class phpbb_functional_test_case extends phpbb_test_case $iohandler->set_input('email_enable', true); $iohandler->set_input('smtp_delivery', '1'); - $iohandler->set_input('smtp_host', 'nxdomain.phpbb.com'); + $iohandler->set_input('smtp_host', ''); $iohandler->set_input('smtp_auth', 'PLAIN'); $iohandler->set_input('smtp_user', 'nxuser'); $iohandler->set_input('smtp_pass', 'nxpass');