Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 15 of 49
  1. #1
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default New script now up to let you clean up your mail queue from WHM

    As the title says, I have a new script now up to let you clean up your mail queue from WHM. Go to my scripts front page at http://www.premierwebsitesolutions.com/scripts/ or go right to where the new script is at http://www.premierwebsitesolutions.com/scripts/mail/.

    Upload the script to your server, set it up and add a link in your WHM, and you will be able to delete any emails sitting in the queue that match a search term you specify.

    - delete all emails from a certain domain
    - delete all emails to a certain address
    - delete all emails containing a certain phrase

    These functions can be done with the search function in shell, but this makes it easy to do from your WHM.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  2. #2
    Member
    Join Date
    Jun 2002
    Posts
    18

    Default

    thank's for your script...
    it's work

    is it possible to add the script to cron (of course with some addon variable to match our criteria) ?

    I think it's ussable to automaticly delete mailqueue that match our criteria

    Regards

  3. #3
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Not a bad idea. I'll try to do it later today or tomorrow.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  4. #4
    Zaf
    Zaf is offline
    Member
    Join Date
    Aug 2005
    Posts
    119

    Default

    Quote Originally Posted by PWSowner
    As the title says, I have a new script now up to let you clean up your mail queue from WHM.
    Wish i had seen this post before, I just had 10000 mails frozen in the queue, i got down and wrote a small script to do it for me after reading a few posts here. Anyway, thanks a lot.
    EDIT: few posts here = other threads in the cpanel forums (not this)
    Last edited by Shahzada; 11-02-2005 at 05:04 AM.

  5. #5
    Member
    Join Date
    Nov 2001
    Posts
    492

    Default

    Just a suggestion, but maybe you could submit this to the cpanel people as a possible script to include with WHM as default. It could be very handy tool!

    Thanks.

  6. #6
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Quote Originally Posted by electric
    Just a suggestion, but maybe you could submit this to the cpanel people as a possible script to include with WHM as default. It could be very handy tool!

    Thanks.
    I told cpanel a while back that they were free to put any of my scripts into their system if they want. Any they do integrate won't have to be kept up to date by me.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  7. #7
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Great script idea! We've been needing this for a while.

    Just thought I'd mention that it's better not to get into the situation where you need to clean up in the first place. I limit the number of emails someone can send per hour to a smallish number; if they need more I'm happy to up the limit, but most people don't. This way people can't clog the system up if one of their scripts runs away. (I know runaway scripts isn't the only cause of large email queues, which is where Mike's script comes in handy!!)

  8. #8
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Quote Originally Posted by brianoz
    Just thought I'd mention that it's better not to get into the situation where you need to clean up in the first place. I limit the number of emails someone can send per hour to a smallish number
    Good point, and I agree. The mail queue shouldn't need cleaning very much with proper setups and management. I almost never see more than 100 emails in my queue. The only reason I wrote the script in the first place was because once when I checked the queue, there were over 1000 emails in it, so I started looking at a few to delete the spam ones and noticed common words in many of them. That's when I thought "why not write a simple script to do the looking for me".

    I like tinkering with perl, so I like using it to automate things.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  9. #9
    Member
    Join Date
    Aug 2001
    Posts
    132

    Default

    I've implemented this script on one server and it's working great -- thanks!

    On another server, however, I got the error message "We can't seem to find one or both of the input or msglog folders"

    I checked and the exim path is indeed /var/spool/exim and the folders /var/spool/exim/input and /var/spool/exim/msglog do exist and do have the expected files in.

    However, the script is expecting /var/spool/exim/input for example to have a number of subfolders a, b, c, ... etc. This server does not have this -- all the files are in the same folder.

    So, I amended the piece of script just after the test for the input and msglog folders, as follows:

    #foreach $dir (@folders) {
    # @files = `ls -1A $exim_path/input/$dir`;
    @files = `ls -1A $exim_path/input`;
    foreach $file (@files) {
    chomp($file);
    open (FILE,"$exim_path/input/$dir/$file") or next;
    @email = <FILE>;
    close (FILE);
    foreach $line (@email) {
    if ($line =~ /$searchterm/) {
    $tmp = "$dir/$file";
    push(@todelete,$tmp);
    last;
    }
    }
    }
    #}

    to remove the loop round the subfolders.

    PWSowner -- is this the correct solution? Cheers.

  10. #10
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    That should do it, although you probably found out by now.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  11. #11
    Member
    Join Date
    Aug 2001
    Posts
    132

    Default

    Cheers Mike, it works fine with the amendment.

    *Excellent* script by the way, it helps a lot to keep our mail queues down to a reasonable size. Hope that this functionality will make it into WHM "officially" at some point.

  12. #12
    BANNED
    Join Date
    Jul 2005
    Posts
    537

    Default

    I have never ever had an issue with messages piling up in the queue. We get may 1 or 2 messeages every few days other than that we have never had this issue. I guess we are pretty efficient in weeding out all the crap that would get stuck in the queue. The only reason why i would see messages getting stuck there is if you spam filtering techniques are seriously lacking. I running the following on every box and have yet to ever see a queue pilup.

    MS + SA + Pyzor + DCC + Razor + SURBL + Mod_Sec for comment spam and illegial ip spam blocklist.

  13. #13
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    True, with a good setup the mail queue should never need cleaning. I wrote this script back when blackhole was being used by default and the mail system changed, causing failed messages being sent back to pile up. Now as long as default addresses are set to fail, the queue should never get very big. I usually only have about 10 at a time in mine.

    Once in a while though, things may happen to cause the queue to grow, then it's nice to be able to clean it out without having to just delete everything.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  14. #14
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    I tried it on my server but it doesn't start (impossible to show...) .
    http://61.17.76.235:2086/cgi/PWScleanmailqueue.cgi

    It works only if I execute from command line with
    perl PWScleanmailqueue.cgi

    Any idea ? Permissions are ok, root:root 700 uploaded with ASCII mode.


    Thank you
    Last edited by Radio_Head; 11-14-2005 at 04:33 AM.
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  15. #15
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    PM me if you want me to take a look.

    Quote Originally Posted by Radio_Head
    I tried it on my server but it doesn't start (impossible to show...) .
    http://64.157.176.235:2086/cgi/PWScleanmailqueue.cgi

    It works only if I execute from command line with
    perl PWScleanmailqueue.cgi

    Any idea ? Permissions are ok, root:root 700 uploaded with ASCII mode.


    Thank you
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Similar Threads & Tags
Similar threads

  1. mail queue checker script for windows smarter mail server
    By anilg in forum New User Questions
    Replies: 0
    Last Post: 10-21-2008, 04:18 AM
  2. Detect exim mail queue script
    By smksa in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-22-2007, 10:57 PM
  3. step by step to clean up mail queue
    By salvatore333 in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 07-16-2005, 10:01 AM
  4. WHM Mail Queue
    By frattay22 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-21-2004, 01:39 PM
  5. What's the root command to clean out exims queue?
    By DWHS.net in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 07-26-2003, 05:37 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube