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.

Delete mail queue older than 3 days

Discussion in 'E-mail Discussions' started by jameshsi, Sep 26, 2005.

  1. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Hi!
    Is there a way to delete mail queue that already queue for 3 days or above ?
    I don't understand why mail queue, I just feel unconfortable that so many email (20000) queue there, some are older that 7 days.
     
  2. OCX

    OCX Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    232
    Likes Received:
    0
    Trophy Points:
    16

    2000 enails?....sheesh man,

    go here http://www.configserver.com/cp/mailscanner.html

    purchase that..and that que will get a hell of alot smaller!!!!

    the owner of that service/site is "chirpy" on cpanel forums


    OCX
     
  3. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Is that the only solution ?
    We pay cpanel for a hosting management solution, and we still have to pay someone else to get things well done.

    I hope some advanced users can teach me how to solve this problem, appreciated.
     
  4. mohit

    mohit Well-Known Member

    Joined:
    Jul 12, 2005
    Messages:
    553
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sticky On Internet
    Re:

    Hi,
    Chirpy has always helped every member and has never asked anyone to compulsarily buy his products, although his products are very good and helpful.

    you can check your stats who is the User getting all these mails.
    Better idea would be to track the problem as there must be some important mails too in those.

    I would recommend you to see which domains these mails are for or from.
    Set default id of domains to :Fail: so it doesn't comes to queue.
    check if someone is exploiting your mail server to relay spam.

    you can also use the "Advanced exim configuration" editor to set number of days you want mails to be kept in queue.

    see ya,
    mohit
     
  5. clook

    clook Well-Known Member
    PartnerNOC

    Joined:
    Jun 9, 2002
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Preston, UK
    No you don't. You pay cPanel for a control panel which granted, makes the job of the server admin a bit easier (or a bit harder depending which way you look at it ;) ) but certaibly doesn't manage your server for you or claim to. If you need a server admin or your server to be managed you should seek a third party management company or lease a fully managed server.

    // sorry to take thread slightly ot
     
  6. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    Chirpy's solution will handle the 2000 emails, (here also the free software and instructions there too!) but they are really easy to get rid of. Change your retry time at the bottom of the exim.conf to something less than the period of time the emails are from. For example, if the emails are 3 ays old, set the retry to 2 days. Then stop exim and remove all the files in /var/spool/exim/db. Restart exim. The run exim -qff. What that does is remove all retry times in the database for the individual emails. When exim runs the emails now - they are too old for exim to deliver so they are returned or deleted. In this case, they would be deleted as they are undeliverable.
     
  7. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Hi!
    I know chirpy, he is very active in this forum, and he help a lot of people, no doubt at that, but I enjoy to know things, I am not afraid of lost $35 or spend $35 for a professional people work for me, I just afraid of don't know how things are running on my server, so, I am trying my best to understand something and to see how far I can go by myself and you guys' help.

    I spent a few hours on one of my server last night, and I found a big spammer in China always sending spam emails to our server, a few clients' email are receive their spam everyday.

    I ban their IP (they all comes from Yunnan province) in /etc/apf/deny_hosts.rules by entering 220.163.0.0/16 , I am not sure if I do right, but now I see a few mail queue is from my server send to spammer, it is like this:

    059F From: Mail Delivery System <Mailer-Daemon@myserver.com>
    036T To: aagan.aagan@chelseachelseae.net
    059 Subject: Mail delivery failed: returning message to sender


    If I ban their IP, why this email still comes in with no problem ? Maybe he is sending this email using other IP ? But since I ban the IP of chelseachelseae.net, maybe this return email will never send out cause can't connect to his server and these queue will be more and more in my queue ?

    How should I do to ban this spammer from send spam emails to my server ?
     
  8. silversurfer

    silversurfer Well-Known Member

    Joined:
    Dec 29, 2002
    Messages:
    274
    Likes Received:
    0
    Trophy Points:
    18
    1. Login to WHM as root
    2. Click on Exim Configuration Editor
    3. Click on Advanced configuration
    4. In the first box, add
    timeout_frozen_after = 3d

    5. Click Save

    You are done.
     
  9. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Hi!
    So, this means if a queue over 3 days, it will be delete ?

    Thanks a lot.

    Do you have any idea how to prevent the spammer I mention above in server-wide level ?
     
  10. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Hi!
    I just look at the /var/log/exim_mainlog , and see a lot of these:

    2005-10-07 17:27:34 1EMCgo-0005Ey-Gm cancelled by timeout_frozen_after
    2005-10-07 17:27:34 1EMCgo-0005Ey-Gm Completed
    2005-10-07 17:27:34 1EMCYo-0004zr-NQ cancelled by timeout_frozen_after
    2005-10-07 17:27:34 1EMCYo-0004zr-NQ Completed
    2005-10-07 17:27:34 1EMBvo-0002xW-GG cancelled by timeout_frozen_after
    2005-10-07 17:27:34 1EMBvo-0002xW-GG Completed
    2005-10-07 17:27:34 1EMBRo-0000k1-Qs cancelled by timeout_frozen_after
    2005-10-07 17:27:34 1EMBRo-0000k1-Qs Completed
    2005-10-07 17:27:34 1ELKHo-0002zr-2P cancelled by timeout_frozen_after


    Appreciated!
     
  11. silversurfer

    silversurfer Well-Known Member

    Joined:
    Dec 29, 2002
    Messages:
    274
    Likes Received:
    0
    Trophy Points:
    18
    No problem. Have a great day.

    Cpanel /WHM do have some settings that can reduce the queue such as not keeping mails users who have been over the quota etc.
     
Loading...

Share This Page