Sendmail

Flush mail queue :

sendmail -q

Postfix

Flush mail queue :
postfix flush
or
postfix -f

To view mail queue :
mailq

To remove all mail from the queue :
postsuper -d ALL

To remove all mails in the deferred queue :
postsuper -d ALL deferred

To remove Emails in mail queue for specific email address:

mailq | tail -n +2 | grep -v '^ (' | \ gawk 'BEGIN {RS = ""} /user[0-9]@example.com/ {print $1}' | \ tr -d '!' | sudo postsuper -d -