Created
July 17, 2025 05:56
-
-
Save sxlderek/998ae787ec67677fd6d4de9018926f60 to your computer and use it in GitHub Desktop.
send test emails to root, to make sure they forwarded to correct destination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| t="root@$(hostname -f)"; s="sendmail ${t}\n"; echo -e "Subject:${s}" | sendmail -v $t | |
| t="root"; s="sendmail ${t}\n"; echo -e "Subject:${s}" | sendmail -v $t | |
| t="postmaster@$(hostname -f)"; s="sendmail ${t}\n"; echo -e "Subject:${s}" | sendmail -v $t | |
| t="nonexists@$(hostname -f)"; s="sendmail ${t}\n"; echo -e "Subject:${s}" | sendmail -v $t | |
| t="root"; echo "test $(date)" | mail -s "mail ${t}" ${t} | |
| t="root@$(hostname -f)"; echo "test $(date)" | mail -s "mail ${t}" ${t} | |
| tail -n +30 -f /var/log/mail.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment