inside the mind of a linux admin

exim


/root/rads/check_exim –help

-pushes through all mail from dom

exim -v -Rff redneckacres.com

-manually push queued up mail

exim -bpru |awk ‘{print $3}’ | xargs -n 1 -P 40 exim -v -M

-finds and sorts queued recipients

exim -bp | exiqsumm | sort -nk1

-how many mails in queue

exim -bpc
exim -bp | exiqsumm | less

-freeze all mail from

exiqgrep -i -f luser@example.tld | xargs exim -Mf

– REMOVE all mails from q (skip freeze)

exiqgrep -i -f nobody@ | xargs exim -Mrm


(note that the -f in examples above indicates “from”, specify -r for recipient)

-remove frozen messages

exiqgrep -z -i | xargs exim -Mrm

-read msg header

exim -Mhv msgid-id

-will force those messages out of the queue and should reset the retry time

exim -qff

– search apache running for php/suspicious mailers

check_apache –status | grep php

grep -lr ‘a certain string’ /var/spool/exim/input/ | \sed -e ‘s/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g’ | xargs exim -Mrm

read a message body or headers

exim -Mvh ID reads a message header
or
exim -Mvb ID reads a message body contents

tidy up the queue:

exim_tidydb -t 10m /var/spool/exim retry
exim_tidydb -t 10m /var/spool/exim wait-remote_smtp

SEE WHATS HAPPENING NOW:

exiwhat !?!

Alternative ways to force exim queue delivery:

# exim -bpru | exiqsumm | sed ‘1,4d;$d;s/^.*\ \(.[^\ ]*$\)/\1/’ | xargs -P 10 -n 1 exim -v -qqR
# mailq | grep ‘^..[dhm]’ | awk ‘{print $3}’ | xargs -P 4 -n 1 exim -M

Sometime exiqgrep exit with error Line mismatch when you try to remove emails with the -Mrm option

#exiqgrep -o 604800
Line mismatch: 170d 1IGLxw-0004Tw-Ne
You can remove the particular entry that errors out as follows.

# exim -bpru | grep “170d” | awk ‘{print $2}’

1IGLxw-0004Tw-Ne
1IGTFn-0000VM-UI

#exim -bpru | grep “170d” | awk ‘{print $2}’ | xargs -n 1 -P 20 exim -Mrm

You will see something like,

Spool data file for 1IGLxw-0004Tw-Ne does not exist
Spool data file for 1IGTFn-0000VM-UI does not exist
Continuing, to ensure all files removed
Continuing, to ensure all files removed
Message 1IGTFn-0000VM-UI has been removed or did not exist
Message 1IGLxw-0004Tw-Ne has been removed or did not exist

1 Comment

  • Pankaj on Tuesday, July 20, 2010

    Can you provide me your email id please ….need some help with hosting related queries.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.