My tiny mail-command collection of the very important administrator mail command.
You can test E-Mail-Server create scripts with this useful command or send yourself some notifications.
The simplest one:
1 | echo Testing mail server | mail -s Test kiwi@zeldor.biz |
One trick for subscriptions send mail with specific sender:
1 | echo subscribe | mail -s "Subscribe" flask@librelist.com -- -r "kiwi@zeldor.biz" |
Test E-Mail rejection (if you don’t receive this mail your spamd ist working fine):
1 | echo "XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X" | mail -s Your-Subject kiwi@zeldor.biz |
Send file content as a body of the message (really useful solution for logs):
1 | mail -s "Backup failed" kiwi@zeldor.biz < backup.log |
Send output of system commands:
1 | df -h | mail -s "HDD report" kiwi@zeldor.biz |
Send E-Mail with current date:
1 | echo "Test: $(date)" | mail -s Test kiwi@zeldor.biz |
Leave a Reply