Tuesday, November 12, 2024
Bash Script

Membuat Email alert untuk spamming di postfix

buat file misal check.sh

nano check.sh

#!/bin/bash

cat /var/log/maillog |grep @aol.* > /dev/null

#Email Notification
if [ “$?” = “0” ]; then
echo “Email send to aol” | mailx -s “Send mail spam aol#hotel-smtp” hendro@yuby.com
else
echo “Email send to aol” > /dev/null
exit 1
fi

chmod a+x check.sh

crontab -e

* * * * * /bin/sh /media/check.sh >/dev/null 2>&1

(Visited 33 times, 1 visits today)
Baca Juga :  Script to alert Memory (RAM)

Similar Posts


Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270