====== Exim4 - Managing emails ====== ===== Removes Nobody Mail ===== for i in `exiqgrep -i -f nobody`; do exim -Mrm $i; done ===== Removes Mail older than 3 Days ===== for i in `exiqgrep -i -o 259200`; do exim -Mrm $i; done ===== Removes Mail with weird Characters (Spam) ===== for i in `exiqgrep -i -f "^<>$"`; do exim -Mrm $i; done ===== Delete mails from a particular domain ===== for i in `exiqgrep -i -f domain.com`; do exim -Mrm $i; done ===== Delete mails to a particular domain ===== for i in `exiqgrep -i -r domain.com`; do exim -Mrm $i; done ===== Flush the entire Mail queue ===== for i in `exiqgrep -i -f `; do exim -Mrm $i; done exim -bp | exiqgrep -i | xargs exim -Mrm ===== Run Mail queue ===== runq -qqff& ===== Who is having large number of emails? ===== exim -bp | exiqsumm ===== To check message header ===== exim -Mvh messageid ===== To check message content ===== exim -Mvb messageid