The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Command for removing Frozen messages here!!! but i have other problem to solve :)

Discussion in 'General Discussion' started by bsasninja, Feb 21, 2005.

  1. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    Running this command from your command line will wipe out all the frozen messages stuck in the mail queue of exim.

    exim -bpr | grep '*** frozen ***' | awk '{print $3}' | xargs exim -Mrm


    Well I created a file called frozen in /usr/bin/frozen and inside of it I wrote the line that is above. I chmoded it to 0755 and when I type frozen logged as root in any part of the server run this command and delete all frozen messages.

    So i wanted to make this task automatic in crontab I added:

    */15 * * * * /usr/bin/frozen

    But when the daemon runs every 15 minutes I got this error mailed to root:

    /usr/bin/frozen: line 2: exim: command not found
    xargs: exim: No such file or directory

    Anyone knows what is happening????????????????????? I cant figure out what´s going one, cause in the command line works fine but when the cron runs the same script gives this error.

    Please help. :)
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well,

    Clearing out your mail queue like that is never a good idea. You have a mail queue for a very good reason and if you're finding emails queued that should not be, then you should be fixing the problem rather than just deleting the emails like that.

    That aside, looks like you need to specify the path to the exim binary for some reason in your script.
     
  3. bsasninja

    bsasninja Well-Known Member

    Joined:
    Sep 2, 2004
    Messages:
    528
    Likes Received:
    0
    Trophy Points:
    16
    Fixed

    I fixed the error this should be writed in the file to get it work correctly:

    /usr/sbin/exim -bpr | grep '*** frozen ***' | awk '{print $3}' | /usr/bin/xargs /usr/sbin/exim -Mrm


    The path´s to each command were missing, now works fine. If you want no report mail to root must be

    */60 **** /usr/bin/frozen > /dev/null 2>&1

    (runs every 60 mins)


    I did this for this reason, i got several messages stuck in the queue (mostly spam) address like daf84w5rif@yahoo.com or fisadr90jf@hotmail.com so this remove them, and let me some time to analize them. (i mean before the cron runs)

    Bye :cool:
     
    #3 bsasninja, Feb 21, 2005
    Last edited: Feb 21, 2005
  4. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That thread is completely out of date now, though, since cPanel has been using verify = recipient for a long time now (nearly a year) in the standard cPanel exim configuration. The impression from the thread seems to be that you should not use :fail: which of course you should with the default cPanel configuration:
    http://www.configserver.com/free/fail.html
     
Loading...

Share This Page