I apologize if this is a dumb/redundant question.
I have an Ubuntu Server 16.04, main use is as a test environment and learning experience. I have SSH setup on this server that runs fine. I have mailutils ssmtp installed to use a cron job to send me an email every day with my external IP. I'm too lazy/cheap at this point to setup a static IP.
Whenever I get this email, it automatically BCCs address@servername and ip@servername. I can't seem to figure out where/why this is happening.
Below is the script I'm using.
Code is borrowed from another source not my own.
#!/bin/sh
SUBJ="Server IP Address"
EMAIL="email@gmail.com"
ip2=""
ip2=$(wget -qO- ifconfig.me/ip)
echo "$ip2" | mail -s $SUBJ $EMAIL
exit
fi
I also have this issue when Logwatch sends out the report email except to root@servername.
Please let me know if I am neglecting to give more information or if this is just really dumb.
I tried to check for a possible fix already but might have missed it due to wording. Thank you for your help.