This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mail-reject.sh >> /root/scripts/cron.log | |
email="" | |
dir="/tmp/" | |
file="/var/log/mail.info" | |
occur="reject" | |
cd $dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mail-blocked.sh >> /root/scripts/cron.log | |
email="" | |
dir="/tmp/" | |
file="/var/log/mail.info" | |
occur="Blocked" | |
cd $dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mail-bounced.sh >> /root/scripts/cron.log | |
email="" | |
dir="/tmp/" | |
file="/var/log/mail.info" | |
occur="status=bounced" | |
cd $dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/httpd-errors.sh >> /root/scripts/cron.log | |
email="" | |
dir="/tmp/" | |
file="/var/log/httpd/*/error.log" | |
cd $dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 1 0 * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/mail-purge.sh >> /root/scripts/cron.log | |
# Search messages more than 14 days in the appropriate directories and removes | |
find /var/vmail/ -regex '.*/\.\(Trash\|Junk\|Deleted\ Messages\)\(/.*\)?\/\(cur\|new\)/.*' -type f -ctime +14 -delete | |
# Dovecot is restarted to refresh quota (to update the .quotausage file) | |
/etc/init.d/dovecot restart | |
# since version ~2.2 (need userdb iterate): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Squid required: | |
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache | |
Firewall section: | |
config redirect | |
option src 'lan' | |
option proto 'tcp' | |
option src_ip '!192.168.1.1' | |
option src_dport '80' | |
option dest_ip '192.168.1.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to = "youremail@gmail.com"; | |
$subject = "DKIM test."; | |
$body = "Hi,\nThis is an DKIM test.\nGo check gmail header.; | |
if (mail($to, $subject, $body)) { | |
echo("<p>Successfully sent!</p>"); | |
} else { | |
echo("<p>Failed!</p>"); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadPlugin tail | |
<Plugin "tail"> | |
<File "/var/log/mail.log"> | |
Instance "postfix" | |
# number of connections | |
# (incoming) | |
<Match> | |
Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: connect from\\>" | |
DSType "CounterInc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadPlugin tail | |
<Plugin "tail"> | |
<File "/var/log/fail2ban.log"> | |
Instance "fail2ban" | |
<Match> | |
Regex "Ban" | |
DSType "CounterInc" | |
Type "counter" | |
Instance "fail2ban-ban" | |
</Match> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# cron ex: 0 * * * * /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /root/scripts/bind-errors.sh >> /root/scripts/cron.log | |
email="" | |
if [ -f /etc/bind/*.err ] | |
then | |
CONTAIN=$(ls -lah /etc/bind/*.err) | |
echo -e "Erreur du serveur Bind, zone:\n $CONTAIN" | mail -s "Rapport d'erreur Bind" $email |
OlderNewer