How to Delete Exim Email For A Particular User From Mail Server Queue

How to Delete Exim Email For A Particular User From Mail Server Queue

To delete Exim email for a particular user from the mail server queue, you can use the exim -bp command to list the messages in the queue, and then use the exim -Mrm command to delete the desired messages.

Here is an example of how to delete all messages in the queue for a user with the email address user@example.com:

  1. Open a terminal window and log in to your mail server.
  2. Run the following command to list the messages in the queue:
‮fer‬er to:lautturi.com
exim -bp

This will display a list of the messages in the queue, including the message ID, the sender, the recipient, and the size of each message.

  1. Run the following command to delete all messages in the queue for the user:
exim -bp | grep user@example.com | awk {'print $3'} | xargs exim -Mrm

This command will search the output of the exim -bp command for messages with the specified recipient email address, extract the message IDs, and pass them to the exim -Mrm command to delete the messages.

Keep in mind that this will delete all messages in the queue for the user, regardless of whether they are incoming or outgoing. If you only want to delete incoming messages, you can modify the grep command to search for messages with the specified sender address instead of the recipient address.

You can also use the -f option with the exim -Mrm command to specify a particular message ID to delete. For example:

exim -Mrm -f message_id

Replace message_id with the ID of the message you want to delete.

You can find more information about the exim command and its options in the Exim documentation: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-exim_command_line.html

Keep in mind that you will need to have the appropriate permissions to delete messages from the mail server queue. You may also need to consult the documentation for your mail server or seek assistance from a qualified technician if you encounter any issues.

Created Time:2017-10-28 21:38:57  Author:lautturi