Hands-on task
Mail delivery summary by status
The mail relay writes the log /var/log/mail/delivery.log: time, message id, recipient, sometimes an intermediate hop, and the last word is the status (sent, deferred, bounced). Lines differ in length. Count how many messages are in each status and write lines <status> <count> to /root/delivery_summary.txt — one per status.
- awk
- $NF
- sort
- uniq -c
- log summary