mirror of
https://github.com/MailScanner/v5.git
synced 2025-02-26 08:25:24 +08:00
28 lines
618 B
Text
28 lines
618 B
Text
|
#!/bin/bash
|
||
|
#
|
||
|
# cron script to clean up MailScanner quarantine
|
||
|
#
|
||
|
# Written by Jerry Benton <mailscanner@mailborder.com>
|
||
|
#
|
||
|
|
||
|
# how many days to keep quarantined messages if not defined
|
||
|
q_days=30
|
||
|
|
||
|
# bail if directory not present
|
||
|
if [[ ! -d /var/spool/MailScanner/quarantine ]]; then
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
# load user-defaults
|
||
|
if [[ -f /etc/default/mailscanner ]]; then
|
||
|
. /etc/default/mailscanner
|
||
|
fi
|
||
|
|
||
|
# go to mailscanner spool directory
|
||
|
cd /var/spool/MailScanner/quarantine
|
||
|
|
||
|
# remove old files and directories
|
||
|
find . -type f -mtime +$q_days -exec rm -f {} \; >/dev/null 2>&1
|
||
|
find . -type d -empty -delete >/dev/null 2>&1
|
||
|
|
||
|
exit 0
|