Exim cheat sheet – Commands for troubleshoot mail issues in cPanel/DirectAdmin or any exim mail server

Below are the most common exim commands which helps an Administrator to ease his life

Print a count of the messages in the queue:

exim -bpc

Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):

exim -bp

Print a summary of messages in the queue (count, volume, oldest, newest, domain, and total

exim -bp| exiqsumm

Print what Exim is doing right now:

exiwhat

To check if the server routes the mail properly use exim -bt

# exim -bt alias@localdomain.com
user@thishost.com
    <-- alias@localdomain.com
  router = localuser, transport = local_delivery
root@localhost# exim -bt user@thishost.com
user@thishost.com
  router = localuser, transport = local_delivery
root@localhost# exim -bt user@remotehost.com
  router = lookuphost, transport = remote_smtp
  host mail.remotehost.com [1.2.3.4] MX=0

Display all of Exim’s configuration settings:

exim -bp

exiqgrep

Its used for grepping through the  exim queue.

search the queue for messages from a specific sender :

exigrep -f  user@domainname.com

Search the queue for a specific reciepient

exigrep -r user@domainname.com

To print messages older than the specified number of seconds use -o .

For example, messages older than 1 day:

exigrep -o 86400

To print messages younger than specified number of seconds use -y

Messages younger than one day can be listed  using the command

exigrep -y 86400

Print just the message-id of the entire queue:

exiqgrep -i

Managing the queue

Start a queue run:

exim -q -v

Start a queue run for just local deliveries:

exim -ql  -v

Remove a message from the queue:

exim -Mrm <message id >

Freeze a message:

exim -Mf <message id >

Thaw a message:

exim -Mt <message id>

Deliver a message, whether it’s frozen or not, whether the retry time has been reached or not:

exim -M <message id>

Deliver a message, but only if the retry time has been reached:

exim -Mc <message_id>

Force a message to  Freeze and bounce as “Canceled by Admin”

exim -Mg <message id>

Remove all frozen mails

exigrep -z -i | xargs exim -Mrm

Remove all messages older than five days (86400 * 5 = 432000 seconds):

exigrep -o 432000 -i | xargs exim -Mrm

Freeze all queued mail from a given sender

exiqgrep -i -f user@domain.com | xargs exim -Mf

View a message’s headers:

exim -Mvh <messageid>

View a message’s body:

exim -Mvb <message id>

View a message’s logs:

exim -Mvl <message id>

Post to Twitter Tweet This Post

Continue Reading

User stats in directadmin admin area – Solved with a good client’s help :)

When one of our clients, Mr. Xavier opened an issue with us regarding the Usage stats not being shown, we were certain that this is a bug with DirectAdmin in the way how its license are read. We changed the ethernet_dev in directadmin.conf, but that didn’t work out.

Client was asking us,

In Admin Area –> Complete Usage Statistics –> Usage stats for venet0:0 is showing “None”

It’s possible to fix this to reflect the traffic of this virtual adapter?

DirectAdmin didn’t give a direct solution. Instead provided us with a complete packed files related to DirectAdmin. So the solution was this.

cd /usr/local/directadmin
wget -O new.tar.gz http://files.directadmin.com/7694310/packed_es50.tar.gz
tar xvzf new.tar.gz
./directadmin p
killall -9 directadmin
./directadmin d
/etc/init.d/directadmin restart

For anyone facing this issue. I didn’t check more deeper into what changed, but must be related to htmls in data page on how device gets read.

Post to Twitter Tweet This Post

Continue Reading

Your email:

 

Post to Twitter Tweet This Post

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later