Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to remove all [System] mails from mailqueue?

Discussion in 'E-mail Discussion' started by postcd, Aug 12, 2014.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    How to remove all queued exim mails where sender is [System] ?
    or all queued emails which body contains certain phrasse?

    i have WHM root access

    (via command line preferably)

    ---
    This command removed somethins and is claimed to "removing failed delivery messages to (likely) non-existent senders: "
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 postcd, Aug 12, 2014
    Last edited: Aug 12, 2014
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    The following third-party document should be of help to you:

    Exim CheatSheet

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    thx, but i did not found command that would do this on above mentioned url.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    The URL I referenced shows:

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    watch the text bellow that command:
    "If you are deleting these files directly, YOU ARE DOING IT WRONG! Use the appropriate exim command to properly deal with the queue."

    im unsure what does it mean, but i dont know how to use above command to delete the messages containing before mentioned phrasse
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    It's stating that it's better to use a command such as "exim -Mrm" (As in the example) than to use "rm" to directly remove messages from the directory.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    what is the command to remove [System] sender emails?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    One command to use would be:

    Code:
    exiqgrep -i -f '<System>' | xargs exim -Mrm
    However, you should replace "System" with the actual "FROM" address if you notice it's different. Please keep in mind that users will not always simply provide you with the exact commands to use. Often times, you will get referred to documents or third-party websites where you must formulate those commands on your own.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    Yours mentioned command says:
    "exim: no message ids given after -Mrm option"
    but i dont know these ids, i want to delete all that match the mentioned [System] phrasse. From WHM queue manager i can filter based on Sender/Recipient, but when i enter System or [System] it dont shows anything even there is alot of them in queue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Right, review a message header, and look to see where the "FROM" address stems from. You can replace "system" with that "FROM" address in the command I provided.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    my queue is now empty so i cant get message header as you suggest..

    i think i can get it like:

    exim -bp

    then i know messageID, so i do:

    exim -Mvh messageID

    but FROM addresses are random ones, its generated by spam script. so are you sure your advice will be working there?

    I have not found on how to delete example all emails containing certain phrasse in body, or i found example account name forumhea was abused so i found in spam mail

    so you see "-helo_name subdomain.mydomain.net" (i replaced so its hidden what is real domain name), which identiffied abuse account which is sending spam emails.. so not sure if i can list/delete mails based on this value "-helo_name XYXY"?

    there are some handy exim commands
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can always play around with the "exiqgrep" command to see the results without deleting the messages. EX:

    Code:
    exiqgrep -i -f '<System>' 
    This leaves out the removal part of the command, so you can test out different strings and see which one works best for you before actually adding in the removal aspect.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice