diff --git a/mailscanner/functions.php b/mailscanner/functions.php
index 8b7512e38..29abfec30 100644
--- a/mailscanner/functions.php
+++ b/mailscanner/functions.php
@@ -1752,6 +1752,10 @@ function get_conf_var($name, $force = false)
*/
function parse_conf_dir($conf_dir)
{
+ if (!realpath($conf_dir)) {
+ $conf_dir = rtrim(MS_CONFIG_DIR, '/') . '/' . ltrim($conf_dir, '/');
+ }
+
$array_output1 = [];
if ($dh = opendir($conf_dir)) {
while (($file = readdir($dh)) !== false) {
diff --git a/mailscanner/msconfig.php b/mailscanner/msconfig.php
index 311275b49..cbbd07c34 100644
--- a/mailscanner/msconfig.php
+++ b/mailscanner/msconfig.php
@@ -36,7 +36,7 @@
audit_log(__('auditlog27', true));
$conf_dir = get_conf_include_folder();
- $MailScanner_conf_file = '' . MS_CONFIG_DIR . 'MailScanner.conf';
+ $MailScanner_conf_file = MS_CONFIG_DIR . 'MailScanner.conf';
echo '
';
echo '' . __('msconfig27') . ' |
';
diff --git a/tests/fixtures/assets/MailScanner/MailScanner.conf b/tests/fixtures/assets/MailScanner/MailScanner.conf
index 2ce88cb0f..d8daf8e16 100644
--- a/tests/fixtures/assets/MailScanner/MailScanner.conf
+++ b/tests/fixtures/assets/MailScanner/MailScanner.conf
@@ -3307,6 +3307,6 @@ Minimum Code Status = supported
# They will be read and processed in alphabetical order.
#
#
-include /Users/manuel/Projects/mailwatch/1.2/tests/fixtures/assets/MailScanner/conf.d/*
+include ./conf.d/*
# End Of File
diff --git a/tests/fixtures/assets/MailScanner/conf.d/demo.conf b/tests/fixtures/assets/MailScanner/conf.d/demo.conf
index 4fa89600f..75af5f5c5 100644
--- a/tests/fixtures/assets/MailScanner/conf.d/demo.conf
+++ b/tests/fixtures/assets/MailScanner/conf.d/demo.conf
@@ -1,2 +1,4 @@
MTA = postfix
Virus Scanners = f-secure-12
+%org-name% = ACME
+%org-long-name% = Acme Corporation
\ No newline at end of file