2023-12-14 20:13:25 +00:00
|
|
|
# This script is to send an email to everyone in order to create their email folder.
|
|
|
|
# would create it using doveadm but that seems like its not possible.
|
|
|
|
|
|
|
|
echo "Subject: Testing, please ignore
|
|
|
|
Testing please ignore" > email.txt
|
|
|
|
|
2023-12-16 04:23:21 +00:00
|
|
|
FROM=/skynet_old/mail
|
|
|
|
TO=/var/vmail/skynet.ie
|
2023-12-14 20:13:25 +00:00
|
|
|
|
2023-12-16 04:23:21 +00:00
|
|
|
|
|
|
|
for dir in $FROM/*;
|
2023-12-14 20:13:25 +00:00
|
|
|
do
|
|
|
|
username=$(basename "$dir");
|
|
|
|
|
|
|
|
if [[ $username == bogus* ]] || [[ $username == BOGUS* ]];
|
|
|
|
then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-12-16 04:23:21 +00:00
|
|
|
if [ ! -d "$TO/$username" ]; then
|
|
|
|
sendmail "$username@skynet.ie" < email.txt
|
|
|
|
echo "Mail Sent: $username"
|
|
|
|
fi
|
2023-12-14 20:13:25 +00:00
|
|
|
|
|
|
|
done
|