Skip to main content

Insted of using WHM --> Mail Queue Manager, what would be the shell equivalent for this?

Comments

6 comments

  • cPanelMichael
    Hello :) The following third-party URL is a good resource for Exim queue commands: Exim Cheatsheet Thank you.
    0
  • jols
    Thanks very much. I'm getting very close to do what I need, but keep running into the same error. At shell, after running this: grep -R -l YourCoffeeRewards /var/spool/exim/msglog/*|cut -b26-|xargs exim -Mrm
    I get this: exim: no message ids given after -Mrm option And if I run this: exim -Mrm `grep -lr 'YourCoffeeRewards' /var/spool/exim/input/ | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g'` 2> /dev/null
    I get a page or two of this: Message 1XYeNj-001Ejg-Ro has been removed or did not exist Spool data file for 1XYeNj-001Ejg-Dy does not exist Continuing, to ensure all files removed Spool read error for 1XYeNj-001Ejg-Dy-H: No such file or directory Continuing to ensure all files removed Message 1XYeNj-001Ejg-Dy has been removed or did not exist Spool data file for 1XYeRt-001QEq-FW does not exist Continuing, to ensure all files removed Spool read error for 1XYeRt-001QEq-FW-H: No such file or directory Continuing to ensure all files removed Message 1XYeRt-001QEq-FW has been removed or did not exist
    But still, tons of email from "YourCoffeeRewards" remains in the queue. And if I just run this: grep -lr 'YourCoffeeRewards' /var/spool/exim/input/ I get many, many hits, like so: /var/spool/exim/input/p/1XYeSp-001WFj-9b-H /var/spool/exim/input/v/1XYeSv-001WHe-6Z-H /var/spool/exim/input/i/1XYeOi-001Gi6-J0-H /var/spool/exim/input/9/1XYeO9-001ErJ-3n-H /var/spool/exim/input/U/1XYeOU-001Evt-NR-H /var/spool/exim/input/U/1XYeSU-001Qwd-Md-H /var/spool/exim/input/T/1XYeOT-001Evg-Kd-H /var/spool/exim/input/S/1XYeQS-001Ki3-3j-H
    So I am still wondering how, for example, I can get exim to just delete any email from "YourCoffeeRewards" via the command line?
    0
  • jols
    Oddly, this seems to work on the Pending Queue, but not the Delivery Queue (yes, I have ConfigServer Mail Queues installed): exiqgrep -i|xargs exim -Mrm `grep -lr 'example.com' /var/spool/exim/input | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g'` 2> /dev/null
    0
  • cPanelMichael
    You can always formulate commands without "exim -Mrm" to get a better idea of what the search output is before you delete the actual messages. Thank you.
    0
  • jols
    Thanks, but the confounding issue here is this, I believe, since I use the Configsever Mailscanner system, the exim queues are divided into two parts: Delivery Queue - (described as) Default queue - email waiting for delivery Pending Queue - (described as) Email awaiting processing by MailScanner So effectively all exim commands look at the wrong queue, that is, the Pending Queue rather than the (usually) thousands of messages stacked up in the Delivery Queue. Case in point: When I enter this: exim -bp Or any exim command that takes a tally of the messages in the queue, it always gives stats for the Pending rather than the Delivery queue. So may simple, yet, apparently very challenging quest is to come up with a shell command that will grep then remove messages from the Delivery Queue which contain certain keywords, or are from certain email addresses. Also note: The built in WHM ---> Mail Queue Manager will indeed, tally the messages and allow operations on the Delivery Queue. So again, I am unable to even get a starting point with an exim command that will at least "look at" the proper queue on the server.
    0
  • cPanelMichael
    You may need to temporarily disable MailScanner so you can remove certain messages from the queue if it's interfering with your ability to do so. Or, you may need to consult with MailScanner's documentation to see if there are any alternatives for removing specific emails. Thank you.
    0

Please sign in to leave a comment.