MailWatch
MailWatch copied to clipboard
Proposal for new CRON organisation
I propose to reorganize the cron files.
Rename db_clean.php as mailwatch-db-clean Move quarantine_maint.php to /usr/local/bin/ Move quarantine_report.php to /usr/local/bin/ Rename quarantine_maint.sh as mailwatch-quarantine-maintenance to be put in /etc/cron.daily/ Rename msre_reload.crond as msre_reload Rename mailwatch-db-clean.sh as mailwatch-db-clean Create mailwatch-quarantine-report file to be put in /etc/cron.daily/
New documentation:
----------------------------------
INSTALLATION INSTRUCTIONS
----------------------------------
-------------------------------------------
Database cleanup of maillog records
-------------------------------------------
Put the file mailwatch-db-clean into /etc/cron.daily/
You need to edit conf.php and change the RECORD_DAYS_TO_KEEP definition.
You may need to edit the mailwatch-db-clean to reflect the location of the functions.php file.
--------------------------------------------
Quarantine Maintenance
--------------------------------------------
Put the file quarantine_maint.php into /usr/local/bin/
Put the file mailwatch-quarantine-maintenance into /etc/cron.daily/
You need to edit in conf.php the QUARANTINE_DAYS_TO_KEEP variable.
You may need to edit the quarantine_maint.php to reflect the location of the functions.php file.
For MailScanner v4: Delete the clean.quarantine cron file.
For MailScanner v5: Change the variable for Quarantine Retention to "q_days=0" in /etc/MailScanner/defaults.
You may need to edit the quarantine_maint.php to reflect the location of the functions.php file.
--------------------------------------------
Quarantine Report
--------------------------------------------
Put the file quarantine_report.php into /usr/local/bin/
Put the file mailwatch-quarantine-report into /etc/cron.daily/
You may need to edit the quarantine_maint.php to reflect the location of the functions.php file.
--------------------------------------------
MailScanner Rule Editor
--------------------------------------------
Configure the file msre_reload to fit your need.
Put the file msre_reload into /etc/cron.d/.
See the instructions in tools/MailScanner_rule_editor/INSTALL
Files mailwatch-quarantine-maintenance
# check if script is available
test -x /usr/local/bin/quarantine_maint.php || exit 0
# run script
/usr/local/bin/quarantine_maint.php --clean
exit 0
Files mailwatch-quarantine-report
# check if script is available
test -x /usr/local/bin/quarantine_report.php || exit 0
# run script
/usr/local/bin/quarantine_report.php >/dev/null 2>&1
exit 0
Just for remember. Debian CRON don't work with filename with dot in.
There will not be so much files to move or link around the filesystem in V2, most likely the CLI commands will be something like:
$ bin/mw2-cli quarantine-report
$ bin/mw2-cli quarantine-mainteniance
and so on
Fine system. We can may be use my proposal for the current 1.2?
Hello!
I'm back on this. The current cron files and organisation is source of problem (and support).
Are you ok if I propose a PR to reorganize all this stuff for 1.2?
Only if you review and write the new documentation along with code :wink::wink::wink:
All of the cron.daily stuff can be combined in one script in cron.daily.
Also, the proposed install script should take care of all of this stuff.
Yes, I can do it.
Let me first push the PR first to see and discuss.