Browse by category

Search    |    Advanced search

HowTo :: manage Exim Mail server
Description Command
Who is having large number of emails? /usr/sbin/exim -bp | exiqsumm
To check a message header /usr/sbin/exim -Mvh messageid
To check a message content /usr/sbin/exim -Mvb messageid
To re-run mail queue /usr/bin/runq -qqff&
To flush the entire Mail queue for i in `exiqgrep -i -o 259200`; do exim -Mrm $i; done
To flush and clear mail in queue for a particular domain grep -ri "domain\.com" /var/spool/exim/input/* | rm -fv
/usr/sbin/exigrep -ir DOMAIN | xargs -n1 exim -Mrm
To remove Mail older than 3 Days for i in `exiqgrep -i -f DOMAIN`; do exim -Mrm $i; done
To remove all messages from the Exim queue? /usr/sbin/exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | sh
To remove mail sent by nobody for i in `exiqgrep -i -f nobody`; do exim -Mrm $i; done >> Removes Nobody Mail
To remove certain emails from the exim spool file grep -lir user\@domain\.com /var/spool/exim/input | xargs rm -fv
To delete mails to a particular domain for i in `exiqgrep -i -r DOMAIN`; do exim -Mrm $i; done
To delete mails from a particular domain for i in `exiqgrep -i -f `; do exim -Mrm $i; done
To delete specific user's queue mail grep -lr DOMAIN /var/spool/exim/input/* |xargs rm -rf
To delete all user's mail queue cd /home; for i in *; do grep -q "^$i:" /etc/passwd && echo > $i/mail/inbox; done
To delete mail containing specific pattern like "VIAGRA" from the queue grep -lr 'VIAGRA' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs /usr/sbin/exim -Mrm
To unfreeze all of the messages in the spool, making them candidates to be resent. /usr/sbin/exim -qq
To re-send all the messages in the spool, regardless of them having been frozen in the past. If it's taking a long time, it's possible a DNS lookup is hanging for some reason (possibly the mail server no longer . /usr/sbin/exim -qff
To findout the specific message that's causing the send to hang /usr/sbin/exim -qff -d11
To get rid of frozen messages /usr/sbin/exiqgrep -zi | xargs exim -Mrm
To get rid of frozen messages older than a day /usr/sbin/exiqgrep -zi -o 86400
To clean up mail queue exim -bpu | exiqsumm | mail -s "Exim queue at `DATE`"
Write the date of the mail you want to delete


Other commands that to troubleshoot mail delivery

Exigrep: to search for specific strings in the exim logfile. The reason for this is that it will look for the search string you specify, match that to a message-ID, and then display all the lines pertaining to that message.


Exiwhat: to display what each running exim process is doing at that given moment. This can be helpful in tracking down the cause for hanging exim processes or monitoring exim processes while they perform certain functions during testing.

Add comment
Views: 1492
Votes: 0
Comments: 0

Other articles in this Category