Skip to content

Instantly share code, notes, and snippets.

@sxlderek
Created July 17, 2025 05:56
Show Gist options
  • Select an option

  • Save sxlderek/998ae787ec67677fd6d4de9018926f60 to your computer and use it in GitHub Desktop.

Select an option

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
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