What is SSH?
SSH(Secure Socket Shell) provides authentication by using the private key. It is the root access to your account from the remote system in a secured manner. The VPS and dedicated server have the SSH access. We can use SSH commands to print a list of emails and to delete email from email queue in the servers.
How to Delete email from the Email Queue using SSH?
Exim is an open source Mail Transfer Agent(MTA), which is a program responsible for receiving, routing and delivering e-mail messages. It is used in the Unix-like operating system. The message-IDs that Exim uses to refer to messages in its queue are mixed-case alphanumeric and take the form of XXXXXX-YYYYYY-ZZ. Most commands related to managing the queue and logging, use these message-ids.
To delete an email from the Email Queue use the following command using SSH
exim -Mrm MessageID
This command deletes a specific email from the email queue on the server. If the email is removed successfully, then it will display the following result
Message MessageID has been removed
If the particular mail is currently processed, then that will not be deleted and it shows the following result
Message MessageID is locked