Skip to main content

Setup cron to delete Exim Mail Queue

Comments

8 comments

  • Eminds
    Hello, The emails that you are talking about must be the LFD notification emails, so instead of deleting them, check them.there might be some issue that needs to be addressed OR you can simply disable those LFD notifications from firewall option in WHM.
    0
  • GOT
    To answer your question directly, this command exim -bpru | awk '{print $3}' | xargs exim -Mrm Will delete all the messages in the queue, but it would delete a message even if it was just put in the queue a minute ago. You might be better off changing the exim settings to dump messages out of the queue after a day. You can set this in the advanced exim config editor under the RETRYBLOCK section.
    0
  • Rajesh Chauhan
    Is there any commands line for the second option?
    0
  • GOT
    No the second option is reconfiguring the section in the exim conf.
    0
  • cPanelLauren
    Hello @Rajesh Chauhan While the solution provided by @GOT will work, I do need to point out this is a terrible idea. Rather than delete potentially valid email (that your clients may be need) I'd recommend identifying the cause of the system generated emails as well as WHY they're sitting in the mail queue. Thanks!
    0
  • Rajesh Chauhan
    [QUOTE]exim -bpru | awk '{print $3}' | xargs exim -Mrm
    Is there any option to set this command to set on every day?
    0
  • Suhesh K S
    Hello, You should add it in cron to run it everyday. First, you should check the reason for generating the mails and fix it. That is the good option than deleting the emails without checking it.
    0
  • LucasRolff
    I remember once, people were complaining about the server using a lot of cached memory, they did a cronjob executing every hour, to drop caches... That was a super bad idea... Now, this will be another bad idea :) Please just fix your email instead of clearing the queue with a cron. Cronjobs are great, but never abuse them!
    0

Please sign in to leave a comment.