diff --git a/config/postfix/clear-queue.sh b/config/postfix/clear-queue.sh index 9d8e5f2..3be793f 100644 --- a/config/postfix/clear-queue.sh +++ b/config/postfix/clear-queue.sh @@ -1,6 +1,13 @@ #!/bin/bash -echo "#Clear mail queue every night" >> /etc/crontab -echo "0 0 * * * /opt/clear-queue.sh" >> /etc/crontab -echo "#!/bin/sh" -echo "postfix -f" \ No newline at end of file +echo "#Purge mail queue every night" >> /etc/crontab +echo "0 0 * * * root /opt/clear-queue.sh" >> /etc/crontab +echo "#!/bin/sh" >> /opt/purge-queue.sh +echo "postfix -f" >> /opt/purge-queue.sh +chmod +x /opt/purge-queue.sh + +echo "#Clear mail queue weekly" >> /etc/crontab +echo "@weekly root /opt/clear-queue.sh" >> /etc/crontab +echo "#!/bin/sh" >> /opt/clear-queue.sh +echo "postsuper -d ALL" >> /opt/clear-queue.sh +chmod +x /opt/clear-queue.sh \ No newline at end of file