Exim is a widely used Mail Transfer Agent (MTA) that comes pre-installed on many Linux and Unix-based systems. It is responsible for routing and delivering email messages across networks. Because of its flexibility, scalability, and powerful configuration options, Exim is commonly used on servers that manage large volumes of email traffic.
To simplify administration and troubleshooting, Exim provides a variety of built-in utilities. These tools help system administrators monitor mail queues, analyze logs, manage databases, and maintain server performance. Understanding these utilities can make it easier to diagnose issues and keep your mail server running efficiently.
Below are some of the most commonly used Exim utilities and their functions.
Common Exim Utilities
exiwhat – Check Running Exim Processes
The exiwhat command displays information about what current Exim processes are doing.
The script sends a signal to running Exim processes and then collects their responses. It waits briefly before displaying the results. Because it needs permission to signal the processes, it is usually executed with root privileges.
exiqgrep – Search the Mail Queue
The exiqgrep utility helps administrators search the Exim mail queue using specific criteria.
It works with the exim -bpu command to filter messages based on conditions such as sender, recipient, size, or age.
Common Options
| Option | Description |
|---|---|
-f <regex> | Match sender address |
-r <regex> | Match recipient address |
-s <regex> | Match message size |
-y <seconds> | Match messages younger than given time |
-o <seconds> | Match messages older than given time |
-z | Show frozen messages only |
-x | Show non-frozen messages |
Output Options
-c– Display count of messages-l– Show full message details (default)-i– Display message IDs only-b– Brief output (one line per message)-R– Reverse order display
exiqsumm – Queue Summary Tool
The exiqsumm utility summarizes messages currently waiting in the mail queue.
It reads the output from the exim -bp command and generates a summary showing how many messages are queued for each domain.
Example usage:
exim -bp | exiqsumm Example output:
3 2322 74m 66m example.com This shows the number of queued messages and the time they have been waiting.
exigrep – Search Exim Logs
The exigrep tool is used to search Exim log files for specific patterns.
When a match is found, the tool extracts all related log entries for that message, making it easier to troubleshoot mail delivery issues.
Usage
exigrep [-l] [-t<n>] <pattern> [logfile] It works with both Exim log format and syslog format.
exipick – Select Messages by Criteria
The exipick command lists messages from the mail queue based on specific conditions.
It provides flexible filtering options for administrators who need to locate messages quickly.
To view available options, run:
exipick --help exicyclog – Rotate Log Files
The exicyclog script is used to rotate Exim log files such as:
- mainlog
- rejectlog
This helps prevent log files from growing too large.
Options
| Option | Description |
|---|---|
-k <count> | Number of log files to retain |
-l <path> | Specify log file location |
Some systems may use their own log rotation mechanisms, but exicyclog is useful when those are not configured.
eximstats – Mail Statistics Tool
The eximstats utility analyzes Exim log files and generates statistics about email activity.
It can output results in:
- Plain text
- HTML reports
By default, it shows:
- Number of emails sent and received
- Message volume by host
- Top hosts sending or receiving mail
Statistics can also be generated for domains, email addresses, or individual users.
exim_checkaccess – Test Mail Access Policies
The exim_checkaccess utility tests whether a specific IP address or email address is allowed to send mail.
Example:
exim_checkaccess 10.9.8.7 user@example.com It is a simplified version of the -bh SMTP debugging command, making policy testing easier.
exim_dbmbuild – Create DBM Database Files
The exim_dbmbuild command creates DBM files from input files used in alias or lookup configurations.
Example:
exim_dbmbuild /etc/aliases /etc/aliases.db These files improve lookup performance for Exim configurations.
exinext – Check Retry Information
The exinext utility retrieves retry information for mail delivery attempts.
It looks up domain hosts and displays:
- First failed delivery time
- Last retry attempt
- Next scheduled retry
This helps administrators diagnose mail delivery failures.
exim_dumpdb – Dump Database Contents
The exim_dumpdb tool displays the contents of Exim’s internal databases.
These databases include:
- retry database
- wait-transport database
- callout cache
- ratelimit data
It is useful for examining internal mail server data.
exim_tidydb – Clean Up Databases
The exim_tidydb utility removes outdated records from Exim databases.
By default, it deletes records older than 30 days, but administrators can change the threshold.
Example:
exim_tidydb -t 7d /var/spool/exim retry This removes retry records older than seven days.
exim_fixdb – Modify Database Records
The exim_fixdb tool allows administrators to interactively modify database records.
It is mainly used for testing but can also help resolve certain database issues on live systems.
exim_lock – Mailbox Locking Utility
The exim_lock command locks a mailbox file using the same method as Exim.
This prevents mail agents from modifying the mailbox during maintenance or troubleshooting.
Example:
exim_lock /var/spool/mail/user Once the mailbox is locked, administrators can safely inspect or back up the file.
Conclusion
Exim utilities provide powerful tools for mail server management, troubleshooting, and maintenance. From monitoring active processes and analyzing logs to managing mail queues and databases, these utilities help administrators maintain a reliable email system.
Understanding how to use these commands effectively can significantly improve mail server performance, security, and troubleshooting efficiency.
If you need assistance managing your mail server or troubleshooting Exim issues, professional server administrators can help ensure your system runs smoothly.
Need Help Managing Your Mail Server?
If you require expert assistance with Exim configuration, troubleshooting, or server maintenance, contact SupportPRO Server Admin for professional support services.
