User Tools

Site Tools


exim4:managing_the_queue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exim4:managing_the_queue [2016/11/04 09:14] peterexim4:managing_the_queue [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 4: Line 4:
  
 Start a queue run: Start a queue run:
-root@localhost# exim -q -v+ 
 +<code bash> 
 +exim -q -v 
 +</code> 
 Start a queue run for just local deliveries: Start a queue run for just local deliveries:
-root@localhost# exim -ql -v+ 
 +<code bash> 
 +exim -ql -v 
 +</code> 
 + 
 Remove a message from the queue: Remove a message from the queue:
-root@localhost# exim -Mrm <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -Mrm <message-id> [ <message-id> ... ] 
 +</code> 
 + 
 + 
 + 
 +Delete all queued messages containing a certain string in the body: 
 + 
 +<code bash> 
 +grep -lr 'a certain string' /var/spool/exim/input/ | \ 
 +                sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm 
 +</code> 
 + 
 +**NOTE**:  The above only delves into **/var/spool/exim** in order to grep for queue files with the given string, and that's just because **exiqgrep** doesn't have a feature to grep the actual bodies of messages.  If you are deleting these files directly, YOU ARE DOING IT WRONG!  Use the appropriate exim command to properly deal with the queue. 
 + 
 +If you have to feed many, many message-ids (such as the output of an **exiqgrep -i** command that returns a lot of matches) to an exim command, you may exhaust the limit of your shell's command line arguments.  In that case, pipe the listing of message-ids into xargs to run only a limited number of them at once.  For example, to remove thousands of messages sent from joe@example.com: 
 + 
 +<code bash> 
 +exiqgrep -i -f '<joe@example.com>' | xargs exim -Mrm 
 +</code> 
 + 
 + 
 Freeze a message: Freeze a message:
-root@localhost# exim -Mf <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -Mf <message-id> [ <message-id> ... ] 
 +</code> 
 + 
 Thaw a message: Thaw a message:
-root@localhost# exim -Mt <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -Mt <message-id> [ <message-id> ... ] 
 +</code> 
 Deliver a message, whether it's frozen or not, whether the retry time has been reached or not: Deliver a message, whether it's frozen or not, whether the retry time has been reached or not:
-root@localhost# exim -M <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -M <message-id> [ <message-id> ... ] 
 +</code> 
 + 
 Deliver a message, but only if the retry time has been reached: Deliver a message, but only if the retry time has been reached:
-root@localhost# exim -Mc <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -Mc <message-id> [ <message-id> ... ] 
 +</code> 
 + 
 Force a message to fail and bounce as "cancelled by administrator": Force a message to fail and bounce as "cancelled by administrator":
-root@localhost# exim -Mg <message-id> [ <message-id> ... ]+ 
 +<code bash> 
 +exim -Mg <message-id> [ <message-id> ... ] 
 +</code> 
 + 
 Remove all frozen messages: Remove all frozen messages:
-root@localhost# exiqgrep -z -i | xargs exim -Mrm+ 
 +<code bash> 
 +exiqgrep -z -i | xargs exim -Mrm 
 +</code> 
 + 
 Remove all messages older than five days (86400 * 5 = 432000 seconds): Remove all messages older than five days (86400 * 5 = 432000 seconds):
-root@localhost# exiqgrep -o 432000 -i | xargs exim -Mrm+ 
 +<code bash> 
 +exiqgrep -o 432000 -i | xargs exim -Mrm 
 +</code> 
 + 
 Freeze all queued mail from a given sender: Freeze all queued mail from a given sender:
-root@localhost# exiqgrep -i -f luser@example.tld | xargs exim -Mf+ 
 +<code bash> 
 +exiqgrep -i -f luser@example.tld | xargs exim -Mf 
 +</code> 
 + 
 View a message's headers: View a message's headers:
-root@localhost# exim -Mvh <message-id>+ 
 +<code bash> 
 +exim -Mvh <message-id> 
 +</code> 
 + 
 View a message's body: View a message's body:
-root@localhost# exim -Mvb <message-id>+ 
 +<code bash> 
 +exim -Mvb <message-id> 
 +</code> 
 + 
 View a message's logs: View a message's logs:
-root@localhost# exim -Mvl <message-id>+ 
 +<code bash> 
 +exim -Mvl <message-id> 
 +</code> 
 + 
 Add a recipient to a message: Add a recipient to a message:
-root@localhost# exim -Mar <message-id> <address> [ <address> ... ]+ 
 +<code bash> 
 +exim -Mar <message-id> <address> [ <address> ... ] 
 +</code> 
 + 
 Edit the sender of a message: Edit the sender of a message:
-root@localhost# exim -Mes <message-id> <address>+ 
 +<code bash> 
 +exim -Mes <message-id> <address
 +</code> 
 + 
 + 
 + 
 +Remove bounce messages already in the queue: 
 + 
 +<code bash> 
 +exipick -f '^$' -i | xargs exim -Mrm 
 +</code> 
 + 
 +or, equivalently:  
 + 
 +<code bash> 
 +exipick '$sender_address eq ""' -i | xargs exim -Mrm 
 +</code>
  
exim4/managing_the_queue.1478250875.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki