Exim Commands

Post Reply
gautham
Posts: 14
Joined: Sun Jul 01, 2012 10:32 am

Exim Commands

Post by gautham »

Find the number of emails in queue
exim -bpc
List emails in queue
exim -bp
Forcefully send the emails and if it cant delete that.
exim -qff -v
Delete full emails in queue
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | sh

Delete all mails more than 2 days old
exim -bp | awk '/2d|3d|4d|5d|6d|7d|8d|9d|10d|frozen|<>/ {if ($2 ~ /^1F/) prin t $2; else print $3}' |xargs exim -Mrm
Number of frozen emails :
exim -bpr | grep frozen | wc –l
Delete only frozen
exim -bp | awk '$6~"frozen" {print $3}' | xargs exim -Mrm
Delete emails send FROM a particular email.
exim -bpr|grep root@| awk '{print $3}'|xargs exim -Mrm
Delete emails send to a particular email address
exiqgrep -ir [email protected] | xargs exim -Mrm
Command to remove emails that are more than 20 hours old.
exiqgrep -o 70000 | grep "<" | awk '{print $3}' | xargs exim -Mrm
To print message ID you can use the below command :
exiqgrep -o 5000 | grep "<" | awk '{print $3}'
Change the value "5000" above in such a way that it yields the result you need.

Get details of scripts that are used to send out spam emails :
grep "cwd=" /var/log/exim_mainlog|awk '{for(i=1;i<=10;i++){print $i}}'|sort|uniq -c|grep cwd|sort -n
Gautham G
WebhostingDevelopment.com
Post Reply

Return to “Exim”