Oneliner to cleanup spool mails for each user in Linux

To delete all Linux spool emails for a user we should:

  1. Switch to that user
    sudo su - username
  2. Enter mailx:
    mailx
  3. In mailx - issue:
    d*
    to delete all emails, and after that:
    q
    to quit
I've managed to create an oneliner that will do it for all users. Here it is:
for item in $(du -sh /var/spool/mail/*|grep M|sort -n|cut -f 5 -d\/); do sudo su - $item -c "echo 'd*'| mailx -N"; done