Posted by: Mangesh_Linux_Administrator | August 6, 2010

Monitoring/security of Exim


Some helpful Exim commands:

Number of emails in the mail queue:

[root@server~]#exim -bpc

——————————————————

Frozen mails in a Queue

[root@server~]#exim -bp | grep -c frozen

[root@server~]#exim -bpr | grep frozen | wc -l

——————————————————

Remoing all frozen messages:

[root@server~]#exiqgrep -z -i | xargs exim -Mrm

or

[root@server~]#exim -bpru | grep “frozen” | awk {‘print $3′} | xargs exim -Mrm

——————————————————

Deliver forecfully emails

[root@server~]#exim -qff -v -C /etc/exim.conf &

—————————————-

Remove mails from sender

[root@server~]#exiqgrep -i -f (mail add here) | xargs exaim -Mrm

—————————————-

Remove mails from Recipient

[root@server~]#exiqgrep -i -r (mail add here) | xargs exaim -Mrm

—————————————-

Below command will display total number of emails send as well receive statistics per domain basis.

[root@server~]#exim -bp | exiqsumm | sort -n

——————————————————

Delete mails for particular domain which is largest email sender you got by previous step (4).

[root@server~]#exiqgrep -i -r domainname.com | xargs exim -Mrm

——————————————————

Number of emails sent by perticular domain greping by date:

[root@server~]#grep “Sept 18″ /var/log/exim_mainlog | grep domainname.com | wc -l

——————————————————

Get the content of an email by message id.

[root@server~]#exim -Mvb messageid

——————————————————

Force delivery of single email

[root@server~]#exim -M email-id

——————————————————

Delete particular message id

[root@server~]#exim -Mg messageid

——————————————————

Delete the entire mail queue

[root@server~]#exim -bpru | awk {‘print $3′} | xargs exim -Mrm

——————————————————

Check all mails by username

[root@server~]#exigrep -u username /var/log/exim_mainlog

——————————————————

View an email’s header

[root@server~]#exim -Mvh message-id

——————————————————

View an email’s body

[root@server~]#exim -Mvb message-id

——————————————————

Deliver all emails in mailqueue forcefully

[root@server~]#exiqgrep -i | xargs exim -M

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: