Top 20 Exim Mail Queue Commands
Top 20 Exim Mail Queue Commands
In this post, we are going to see about some of the email queue commands. These commands are normally used by the root users to know about the email queues and why the mails are in queue.
To proceed further, Lets see what is Exim.
Exim is a mail transfer agent used on Unix-like operating systems. Exim is free software distributed under the terms of the GNU General Public License, and it aims to be a general and flexible mailer with extensive facilities for checking incoming e-mail.
The first version of Exim was written in 1995 by Philip Hazel for use in the University of Cambridge Computing Service’s e-mail systems.
To send one message forcefully in Exim
exim -M email-id
This command is used to forcefully delivery of one message in a queue. This situation arrives when an urgent message want to be send but due to long queue is takes time then with this exim command we can send one message forcefully in exim server.
To force another queue run
exim -qf
This command in exim is used to force another queue run.
To flush the frozen message
exim -qff
This command is used to force another queue run and attempts to flush the frozen message in exim server.
To see the logs of a message
exim -Mvl messageID
This command is used to see the logs of a message in exim server. Message ID is the id of the message of which we want to see the log.
To view the body of the message
exim -Mvb messageID
This command is used to view the body of the message. Message ID is the id given by the exim to that message.
To view the header part of the message
exim -Mvh messageID
This command is used to view the header part of the message. Message ID is the id given by the exim to that message.
To remove message without sending any error message
exim -Mrm messageID
This command is used to remove message without sending any error message. Message ID is the id given by the exim to that message.
To giveup and fail message to bounce the message to the sender
exim -Mg messageID
This command is used to giveup and fail message to bounce the message to the sender. Message ID is the id given by the exim to that message.
To know the number of emails in a queue
exim -bpr | grep “<” | wc -l
To know the number of frozen emails in a queue
exim -bpr | grep frozen | wc -l
To delete the frozen mails from the queue
exim -bpr | grep frozen | awk {‘print $3’} | xargs exim -Mrm
To print summary of the messages in the queue
exim -bp | exiqsumm
To show what exim is doing right now
exiwhat
To show number of messages in the queue
exim -bpc
To quickly flush your Exim queue
exim -bp | exiqgrep -i | xargs exim -Mrm
To remove 7 days old emails
exim -bpr | grep 7d | awk {'print $3'} | xargs exim -Mrm;
To view number of mails in queue for each domain
exim -bp | exiqsumm | grep -v ‘\-\-‘ | grep -v ‘Volume’ | grep -v ‘^$’ | sort -bg | awk ‘{print “Volume: ” $1 ” \t Domain: ” $5}’A
Run the following command to pull the most used mailing script’s location from the Exim mail log:
grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F”cwd=” ‘{print $2}’ | awk ‘{print $1}’ | sort | uniq -c | sort -n
To search for a specific email user
exiqgrep -f [user]@domain.com
To search the queue for a specific destiny user
exiqgrep -r [user]@domain.com
To run a traceroute against an email address
exim -bt '<mail id>'
That’s it for now, Hope you liked this blog. If know any other commands kindly share it with the details so that we can publish it with your name.
Kindly share your comments / Feedback to improve us.
To know about RSYNC COMMANDS, Click Here