ow can I permanently delete all e-mail messages in the Sendmail mail server (SMTP) queue using UNIX / Linux command prompt?

You can use the mailq command sendmail -bp command to display a summary of the mail messages queued for future delivery. Type the following command:
# mailq

OR
# sendmail -bp


You can cd to /var/spool/mqueue and delete all files if you want to get rid of all messages in the queue:
# cd /var/spool/mqueue/
# ls
# rm *

OR

Postfix Flush the Mail Command

Traditionally we used the “sendmail -q” command to flush the mail queue under Sendmail MTA. Under Postfix MTA, just enter the following command to flush the mail queue:
# postfix flush
OR
# postfix -f
## OR ##
# postqueue -f

The above command tell Postfix to process the queue now and flush all emails.

How to see emails in Postfix message queues

The postqueue command implements the Postfix user interface for queue management. To see mail queue type any one of the following command:
# mailq
OR
# postqueue -p
Sample outputs:

-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
EC4D438AA57      429 Fri Jun 25 07:54:19  [email protected]
(connect to email-smtp.us-west-2.amazonaws.com[44.229.96.139]:587: Connection timed out)
                                         
 
-- 0 Kbytes in 1 Request.

Note down Postfix Queue ID. For example, EC4D438AA57. Now, we can further review message contents, header, and body in your Postfix queue using Queue ID as follows:
# postcat -vq Queue-ID
# postcat -vq EC4D438AA57

Deleting or removing all emails from Postfix queue

To remove all mail from the queue, enter:
# postsuper -d All

Summary of all commands you need to view and flush the Postfix mail queue:

ActivityCommand
View or see queued mailpostqueue -p
OR
mailq
Flush queued mailpostqueue -f
OR
postfix flush
Purge queued mailpostsuper -d {ID}
To purge all email from the queuepostsuper -d ALL
Delete all deferred from Postfix queuepostsuper -d ALL deferred