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:20] peterexim4:managing_the_queue [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 14: Line 14:
 exim -ql -v exim -ql -v
 </code> </code>
 +
  
 Remove a message from the queue: Remove a message from the queue:
Line 20: Line 21:
 exim -Mrm <message-id> [ <message-id> ... ] exim -Mrm <message-id> [ <message-id> ... ]
 </code> </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:
Line 60: Line 80:
 exiqgrep -z -i | xargs exim -Mrm exiqgrep -z -i | xargs exim -Mrm
 </code> </code>
 +
  
 Remove all messages older than five days (86400 * 5 = 432000 seconds): Remove all messages older than five days (86400 * 5 = 432000 seconds):
Line 80: Line 101:
 exim -Mvh <message-id> exim -Mvh <message-id>
 </code> </code>
 +
  
 View a message's body: View a message's body:
  
 <code bash> <code bash>
-root@localhost# exim -Mvb <message-id>+exim -Mvb <message-id>
 </code> </code>
 +
  
 View a message's logs: View a message's logs:
  
 <code bash> <code bash>
-root@localhost# exim -Mvl <message-id>+exim -Mvl <message-id>
 </code> </code>
  
Line 97: Line 120:
  
 <code bash> <code bash>
-root@localhost# exim -Mar <message-id> <address> [ <address> ... ]+exim -Mar <message-id> <address> [ <address> ... ]
 </code> </code>
  
Line 104: Line 127:
  
 <code bash> <code bash>
-root@localhost# exim -Mes <message-id> <address>+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> </code>
  
exim4/managing_the_queue.1478251224.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki