I just sent a local mail using the following syntax:
echo "Testing" | mail -s "This is just a test" root@localhost
Then I log into root using:
And check my mail. The message is there. If I repeat the mail command and log into root using:
The mail is not in my mailbox. In both cases I am logging into the root account, so what is happening here? It's a fairly new, basic installation of CentOS 7.
I even checked again by logging in using su and when it wasn't there I logged out and back in using sudo -i and sure enough, the mail was there.