3.0.1.5: cron.hourly email is sent when there are files in /etc/MailScanner/conf.d

Report bugs and workarounds
Post Reply
dbrunt
Posts: 64
Joined: 28 Nov 2015 00:09

3.0.1.5: cron.hourly email is sent when there are files in /etc/MailScanner/conf.d

Post by dbrunt » 24 Sep 2016 00:22

The subject says it all.

With our custom files in /etc/MailScanner/conf.d, cron.hourly email is sent every hour.

Code: Select all

drwxr-xr-x. 2 root root 4096 Sep 20 16:05 .
drwxr-xr-x. 6 root root 4096 Sep 21 16:38 ..
-rw-r--r--  1 root root  100 Sep 20 15:12 filename.conf
-rw-r--r--  1 root root  100 Sep 20 15:12 filetype.conf
-rw-r--r--. 1 root root 1118 Oct  3  2013 README
-rw-r--r--  1 root root   48 Sep 20 16:05 scan.messages.conf
-rw-r--r--  1 root root   46 Sep 20 16:00 spam.actions.conf
Contents of files:

Code: Select all

Allow Filenames = %rules-dir%/filename.allow.rules
Deny Filenames = %rules-dir%/filename.deny.rules

Allow Filetypes = %rules-dir%/filetype.allow.rules
Deny Filetypes = %rules-dir%/filetype.deny.rules

Scan Messages = %rules-dir%/scan.messages.rules

Spam Actions = %rules-dir%/spam.actions.rules
Remove the files from the directory and cron.hourly emails stop.
Append the file contents to /etc/MailScanner/MailScanner.conf and there is no email from cron.hourly.
Not sure why it does not like %rules-dir% in the .conf files...
Last edited by dbrunt on 20 Jan 2017 19:22, edited 3 times in total.

dbrunt
Posts: 64
Joined: 28 Nov 2015 00:09

Re: 3.0.1.5: cron.hourly email is sent when there are files in /etc/MailScanner/conf.d

Post by dbrunt » 08 Oct 2016 00:31

Here is the email:

Code: Select all

Subject: Cron <root@efa> run-parts /etc/cron.hourly

/etc/cron.hourly/mailwatch_relay.sh:


Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Notice: Undefined index: %rules-dir% in /var/www/html/mailscanner/functions.php on line 1486

Code: Select all

// expand %var% variables
            if (preg_match("/(%.+%)/", $regs['value'], $match)) {
Line 1486:    $regs['value'] = preg_replace("/%.+%/", $var[$match[1]], $regs['value']);
            }
Why is %rules-dir% undefined in the included files?
Why are there 12 errors when there are only 6 instances of %rules-dir%??

dbrunt
Posts: 64
Joined: 28 Nov 2015 00:09

Re: 3.0.1.5: cron.hourly email is sent when there are files in /etc/MailScanner/conf.d

Post by dbrunt » 20 Jan 2017 21:41

See viewtopic.php?f=13&t=1545&p=5765&hilit=cron#p5765

If variables are referenced in the custom .conf files, apparently they need to be defined there as well.

Post Reply