Wednesday, 11 May 2011

Monitoring/security of Exim

Number of emails in the mail queue:

#exim -bpc

Frozen mails in a Queue

#exim -bp | grep -c frozen

#exim -bpr | grep frozen | wc -l

Removing all frozen messages:

#exiqgrep -z -i | xargs exim -Mrm


#exim -bpru | grep “frozen” | awk {‘print $3′} | xargs exim -Mrm

Deliver forcefully emails

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

Remove mails from sender

#exiqgrep -i -f (mail add here) | xargs exaim -Mrm

Remove mails from Recipient

#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.

#exim -bp | exiqsumm | sort -n

Delete mails for particular domain which is largest email sender you got by previous step

#exiqgrep -i -r | xargs exim -Mrm

Number of emails sent by perticular domain greping by date:

#grep “Sept 18″ /var/log/exim_mainlog | grep | wc -l

Get the content of an email by message ID

#exim -Mvb messageid

Force delivery of single email

#exim -M email-id

Delete particular message ID

#exim -Mg messageid

Delete the entire mail queue

#exim -bpru | awk {‘print $3′} | xargs exim -Mrm

Check all mails by username

#exigrep -u username /var/log/exim_mainlog

View an email’s header

#exim -Mvh message-id

View an email’s body

#exim -Mvb message-id

Deliver all emails in mailqueue forcefully

#exiqgrep -i | xargs exim -M

No comments:

Post a Comment