Showing posts with label Exim mail server commands. Show all posts
Showing posts with label Exim mail server commands. Show all posts

Sunday, December 18, 2011

Exim commands and usage

Find most email IP
==================

tail -1000 /var/log/exim_mainlog |grep '\[' |cut -d[ -f2 |cut -d] -f1|sort -n |uniq -c |sort -n 809
tail -2000 /var/log/exim_mainlog | grep public
   

exim -bp|grep $name Will show the mail in queue for $name
exim -Mvh $MSGID View message header
exim -Mvb $MSGID View message body
exim -M $MSGID Force delivery of message
exim -v -M $MSGID View the transact of message

Force delivery of one message
exim -M email-id

Force another queue run
exim -qf

Force another queue run and attempt to flush the frozen message
exim -qff

View the log for the message
exim -Mvl messageID

View the body of the message
exim -Mvb messageID

View the header of the message
exim -Mvh messageID

Remove message without sending any error message
exim -Mrm messageID

Giveup and fail message to bounce the message to the Sender
exim -Mg messageID

How much mail in the queue?
exim -bpr | grep "<" | wc -l


How many Frozen mails in the queue
exim -bpr | grep frozen | wc -l


Deleteing Frozen Messages
exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm


To find out, how many messages are there in the mail queue:
exim -bpc

To check the mails in the queue:
exim -bp

To force exim update:
/scripts/eximup --force

==== REMOVE MAILS BY ID ====

 exim -v -Mrm (MAIL ID HERE)

==== LIST QUEDED MAILS ====

 exim -bp

==== OUTPUT NUMBER OF QUEDED MAILS ====

 exim -bpc

=== DELETE FROZEN MAILS ====

exim -bp | awk '$6~"frozen" { print $3 }' | xargs exim -Mrm

==== DELIVER FORCEFULLY EMAILS ====

 exim -qff -v -C /etc/exim.conf &

==== FREEZE MAILS FROM SENDER ====

 exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mf

==== REMOVE MAILS FROM SENDER ====

 exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mrm

How much mail in the queue?

 exim -bpr | grep "<" | wc -l