Using the exiqgrep command to filter Exim queue messages
Filter Exim queue msgs with exiqgrep. Options: -b (sender), -r (rcpt), -f (full), -i (ID). Examples & troubleshooting included.
The exiqgrep command is a powerful tool for querying and filtering messages within the Exim mail queue on your Liquid Web server. It allows you to identify specific emails based on various criteria, making it easier to manage and troubleshoot mail flow.
Command options
The exiqgrep command offers several options to refine your search. Here are some of the most commonly used ones:
-b <address>: Matches messages with a sender address of<address>.-r <address>: Matches messages with a recipient address of<address>.-f: Shows the full details of the matching messages.-i <queue_id>: Matches the message with the specified<queue_id>.-M <message_id>: Matches messages with the internal Exim message ID<message_id>.-s <size>: Matches messages larger than<size>(e.g.,-s 1Mfor messages larger than 1 megabyte). You can also use-Sfor messages smaller than the specified size.-t <seconds>: Matches messages that have been in the queue for more than<seconds>.-z: Only count the number of matching messages, without displaying details.-o: Display older messages first.-n: Display newer messages first.
You can combine multiple options to create more specific queries.
Examples
Here are some practical examples of using exiqgrep:
- List all messages in the queue:
exiqgrep - Find messages sent from a specific email address:
exiqgrep -b user@example.com - Find messages destined for a specific email address:
exiqgrep -r recipient@example.net - View full details of messages to a specific domain:
exiqgrep -rf @example.org - Find a specific message by its queue ID:
exiqgrep -i abcdef-ghijkl-mnop - Count the number of messages in the queue from a specific sender:
exiqgrep -b sender@domain.com -z - Find messages that have been in the queue for more than 3600 seconds (1 hour):
exiqgrep -t 3600
Troubleshooting
If you are not getting the expected results with exiqgrep, consider the following:
- Typos in the command or email addresses: Double-check your spelling and syntax. Email addresses are case-sensitive in some contexts, though Exim generally treats them as case-insensitive for matching.
- Incorrect options: Ensure you are using the correct option for the criteria you want to filter by (e.g.,
-bfor sender,-rfor recipient). - No matching messages: It’s possible that no messages in the queue match your specified criteria. Try a broader search to confirm the queue has messages.
- Permissions: You may need appropriate user privileges (often root or a user in the
eximgroup) to run `exiqgrep` effectively. If you encounter “Permission denied” errors, ensure you are executing the command with sufficient privileges (e.g., usingsudo).
If you continue to experience issues using exiqgrep, please open a case or chat with our Liquid Web Support Team for further assistance.