Skip to content

Commit

Permalink
Permit relative path in MailScanner.conf to ease development
Browse files Browse the repository at this point in the history
  • Loading branch information
endelwar committed Sep 10, 2024
1 parent 4b45d7f commit dd16f40
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mailscanner/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion mailscanner/msconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<table border="0" cellpadding="1" cellspacing="1" class="maildetail" width="100%">';
echo '<tr><th colspan="2">' . __('msconfig27') . '</th></tr>';
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/assets/MailScanner/MailScanner.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions tests/fixtures/assets/MailScanner/conf.d/demo.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
MTA = postfix
Virus Scanners = f-secure-12
%org-name% = ACME
%org-long-name% = Acme Corporation

0 comments on commit dd16f40

Please sign in to comment.