Last Updated: February 25, 2016
·
500
· javierwilson

check mail queue using ssh

I have all my hosts listed at "hosts" and use ssh keys to access them all, to check mailq in each of them you can either use fabric or simply ssh:

cat hosts | xargs -i ssh -t -t {} "sudo mailq | tail"

Note: -t -t is required to force pseudo-tty allocation.