Exim
From My Wiki
Contents
- 1 Set exim smtp delay
- 2 Find spamming account
- 3 Queue summary
- 4 List queued messages grouped by address of sender
- 5 Check what Exim is doing right now
- 6 Remove any mail from/to google.com
- 7 Exim commands
- 8 Start a queue run
- 9 Remove all frozen messages
- 10 Remove mails in queue from a particular sender
- 11 Remove mails to a particular sender in the queue
- 12 Test how exim will route a given address
- 13 Display Exim's configuration settings
- 14 Search the queue for messages from a specific sender
- 15 Search the queue for messages for a specific recipient/domain
- 16 Print messages older than the specified number of seconds. Eg: messages older than 1 hour
- 17 Print messages younger than the specified number of seconds. Eg: messages less than an hour old
- 18 Match the size of a message with a regex. Eg: Messages between 500-599 bytes
- 19 Match only frozen messages
- 20 Match only Non-frozen messages
- 21 Print just the message-id of the entire queue
- 22 Start a queue run
- 23 Start a queue run for just local deliveries
- 24 Remove a message from the queue
- 25 Freeze a message
- 26 Thaw a message
- 27 Deliver a message, but only if the retry time has been reached
- 28 Force a message to fail and bounce as "cancelled by administrator"
- 29 Remove all frozen messages
- 30 Remove all messages older than five days (86400 * 2 = 172800 seconds)
- 31 Freeze all queued mail from a given sender
- 32 Add a recipient to a message
- 33 Edit the sender of a message
- 34 Force cleaning all queue:
Set exim smtp delay
echo "sed -i '0,/delay = 20s/s//delay = 5s/' /etc/exim.conf" > /etc/exim/delay_unknown_hosts /etc/init.d/exim restart
Find spamming account
ps -C exim -fH eww | grep home
Queue summary
exim -bp | exiqsumm | head -n 3; exim -bp | exiqsumm | sort -nr | head -n 10
List queued messages grouped by address of sender
exim -bpr | grep -Eo "<[^ ]*@[^ ]*>" | sort | uniq -c | sort -nr | head
Check what Exim is doing right now
root@localhost# exiwhat
Remove any mail from/to google.com
exiqgrep -i -r @booksefer.com | xargs exim -Mrm exiqgrep -i -f @booksefer.com | xargs exim -Mrm
Exim commands
exim -M id #Try to send the message with id id exim -qf (-v) #Tell exim to process the entire queue again exim –qff (-v) #same as qf, but it will flush the frozen messages exim -Mvl id #view the message log for message id exim -Mvh id #view message id's headers exim -Mvc id #view message id's body + headers exim -Mvb id #view message id's body exim -Mrm id #remove message id from the queue exim -Mg id #fail and send a bounce to the sender exim -bp | exiqsumm #Print summary of the messages in the queue exiwhat #show what exim is doing right now exim -bpc #show number of messages in the queue exim
Start a queue run
root@localhost# exim -q -v
Remove all frozen messages
root@localhost# exiqgrep -z -i | xargs exim -Mrm
Remove mails in queue from a particular sender
exiqgrep -i -f user@domain.com | xargs exim -Mrm
Remove mails to a particular sender in the queue
exiqgrep -i -t user@domain.com | xargs exim -Mrm
Test how exim will route a given address
root@localhost# exim -bt user@localdomain.com
Display Exim's configuration settings
root@localhost# exim -bP
Search the queue for messages from a specific sender
root@localhost# exiqgrep -f [luser]@domain
Search the queue for messages for a specific recipient/domain
root@localhost# exiqgrep -r [luser]@domain
Print messages older than the specified number of seconds. Eg: messages older than 1 hour
root@localhost# exiqgrep -o 3600 [...]
Print messages younger than the specified number of seconds. Eg: messages less than an hour old
root@localhost# exiqgrep -y 3600 [...]
Match the size of a message with a regex. Eg: Messages between 500-599 bytes
root@localhost# exiqgrep -s '^5..$' [...]
Match only frozen messages
root@localhost# exiqgrep -z
Match only Non-frozen messages
root@localhost# exiqgrep -x
Print just the message-id of the entire queue
root@localhost# exiqgrep -i
Start a queue run
root@localhost# exim -q -v
Start a queue run for just local deliveries
root@localhost# exim -ql -v
Remove a message from the queue
root@localhost# exim -Mrm [ ... ]
Freeze a message
root@localhost# exim -Mf [ ... ]
Thaw a message
root@localhost# exim -Mt [ ... ]
Deliver a message, but only if the retry time has been reached
root@localhost# exim -Mc [ ... ]
Force a message to fail and bounce as "cancelled by administrator"
root@localhost# exim -Mg [ ... ]
Remove all frozen messages
root@localhost# exiqgrep -z -i | xargs exim -Mrm
Remove all messages older than five days (86400 * 2 = 172800 seconds)
root@localhost# exiqgrep -o 172800 -i | xargs exim -Mrm
Freeze all queued mail from a given sender
root@localhost# exiqgrep -i -f user@example.com | xargs exim -Mf
Add a recipient to a message
root@localhost# exim -Mar [ ... ]
Edit the sender of a message
root@localhost# exim -Mes
Force cleaning all queue:
exim -bp | grep \< | awk '{print $3}' | xargs exim -Mrm