Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%-variables defined in main MS config are not expanded in conf.d config files #1245

Open
RobinR1 opened this issue Jan 18, 2022 · 1 comment

Comments

@RobinR1
Copy link

RobinR1 commented Jan 18, 2022

Issue summary

%-variables defined in main MS config are not expanded in conf.d config files by MailWatch functions.
MailScanner allows to use %-variables defined in main MailScanner.conf file to be used in conf.d-config files. But MailWatch requires %-variables to be defined within the same file where they are used.

Steps to reproduce

  1. Make sure some %-variables are defined in MailScanner.conf
  2. some of those %variables in conf.d config files
  3. Run MailWatch cron job of use web interface

Expected result

No errors

Actual result

Both apache access-log and cron system logging are full of messages like this:

PHP Notice:  Undefined index: %org-name% in /opt/mailwatch/mailscanner/functions.php on line 1894
PHP Notice:  Undefined index: %org-name% in /opt/mailwatch/mailscanner/functions.php on line 1894
PHP Notice:  Undefined index: %etc-dir% in /opt/mailwatch/mailscanner/functions.php on line 1894
PHP Notice:  Undefined index: %etc-dir% in /opt/mailwatch/mailscanner/functions.php on line 1894
PHP Notice:  Undefined index: %rules-dir% in /opt/mailwatch/mailscanner/functions.php on line 1894

Installation

Version and method

  • MailWatch Version: stable 1.2.18
  • Install type: GitHub checkout
  • Updated from an older MailWatch or fresh install: Fresh install

Server configuration

  • Operation System: openSuse Leap 15.3
  • PHP version: 7.4
  • Database: MariaDB 10.5.13
  • Mail Server: Postfix
  • Used web server: Apache version 2.4.43

Client configuration

  • Operation System: openSuse Tumbleweed
  • Browser: Firefox 95.0.2
@shawniverson
Copy link
Member

This is expected behavior the way MailWatch currently is written, but I agree it would be proper to parse the main and conf.d counterparts in their entirety and populate those values, even if they aren't in the same file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants