Little command-line utils to find deferred/bounced/lost emails to specific providers

Looking for ATT users with ‘restricted sms deliver’ problems:

user $> grep “restricted SMS e-mail” /var/log/mail.log | sed ‘s/^.* to=//’ | sed ‘s/,.*$//’ | sed ‘s/[<>]//g' | sed 's/@.*$//' | sort -rn | uniq -c | sort -rn | more
1 6307282195
1 6307213667
1 6306997321
1 6306990660
1 6306676641
1 6306247678

Looking for bounced VZW users:


user $> grep vtext /var/log/doit-mail.log | grep -v “status=sent” | grep “status=deferred” | sed ‘s/^.* to=//’ | sed ‘s/, .*$//’ | sed ‘s/[<>]//' | sed 's/@.*$//' | sort -rn | uniq -c | sort -rn | more
11 3123392171
10 8123202309
9 6302941108
8 8477076867
8 7733320757
8 6179534027
7 8152631645

- more in a bit -