# This script will notify users that email was dropped by clamsmtpd.
#
# Original inspiration from this script: https://h4des.org/blog/index.php?/archives/308-clamsmtp-informing-recipients-abount-email-virus-infection.html
source /etc/mailinabox.conf # load global vars
# For all variables passed when running this script please see "man clamsmtpd.conf"
#pull list of all emails served by this mailserver
dest_email=$(/usr/bin/sqlite3 /home/user-data/mail/users.sqlite "select distinct source from aliases union all select distinct email from users;")
# check every single recipient
for i in $RECIPIENTS;do
# check every single email/alias
for j in $dest_email;do
#check if email address contains hosted domain name