Can someone please give me the ssh comands to setup a cron job to delete my mail queue every couple of hours?
Thank you very much
Thank you very much
Type this with root access:salvatore333 said:Can someone please give me the ssh comands to setup a cron job to delete my mail queue every couple of hours?
Thank you very much
crontab -e
0 */2 * * * /scripts2/killeximq >/dev/null 2>&1
salvatore333 said:Can someone please give me the ssh comands to setup a cron job to delete my mail queue every couple of hours?
Thank you very much
iquest said:Type this with root access:
then add the following linesCode:crontab -e
This will clear your mail queues in every two hours....Code:0 */2 * * * /scripts2/killeximq >/dev/null 2>&1
chirpy said:Bear in mind that this is an extremely bad idea. If you do this you will definitely lose legitimate email. If you want to play with the mail queue you should do it through the mechansims provided with exim. If you're finding that your mail queue is getting out of hand (more than a few hundred emails) then you should fix the root cause of the problem and not ignore it by trying to remove what is an essential part of any MTA.
Sorry, for the wrong command for killing exim mail queues manually. The right command is as follows:salvatore333 said:How do you suggest I go about fixing the root cause of the problem exactly?. I get over 1000 emails every 12 hours and eventually the server crashes if I dont clear it out. My provider states spamd is using alot of system resources.
Thank you very much for everyones help.
/usr/local/cpanel/whostmgr/bin/whostmgr2 killeximq
By searching and a little application. For a start you should have a look through the following post:salvatore333 said:How do you suggest I go about fixing the root cause of the problem exactly?
I saw the link '/scripts2/killeximq' from WHM and thought that it would work from command line as well. I should have checked it before posting it though. Anyway, the cpanel script for cleaning mail queues from command line is:bijo said:No, It don't work. There is no folder /scripts2 and also killeximq command in cpanel And also the time setting is wrong. You have set the cron to work every 30 minute.
clear_queue:
driver = accept
domains = Your.Client
condition = Check for the $message_age here if needed
transport = some_transport_to_save_it_away
clear_queue:
driver = redirect
domains = your.client
condition = Check for the $message_age here if needed
data = :blackhole:
exim -bp | exiqsumm
exim -qff
exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm
exim -bpru|grep '<>'|awk {'print $3'}|xargs exim -Mrm
exim -bpru|awk {'print $3'}|xargs exim -Mrm
Well iquest :p Finally you did a great reply and i get a new information from you, One is the command and second one is the cron related (*/2). This post is really good and It is really appreciatediquest said:I found some interesting links for mailing the queued mails to another email address:
http://freebsd.munk.nu/archives/151-Forwarding-Mail-To-Gmail.html
You can also configure exim.conf in the router section:
orCode:clear_queue: driver = accept domains = Your.Client condition = Check for the $message_age here if needed transport = some_transport_to_save_it_away
You can get a detailed summary of spams with the following command from root:Code:clear_queue: driver = redirect domains = your.client condition = Check for the $message_age here if needed data = :blackhole:
Or you can type the following command and exim will try to deliver the mails in queue including the frozen mails.Code:exim -bp | exiqsumm
If you go through the exim documentation then you will see that if the message is frozen then you can delete them in one line command:Code:exim -qff
if the message is <> then run the following command:Code:exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm
if you need to delete all messages from the queue:Code:exim -bpru|grep '<>'|awk {'print $3'}|xargs exim -Mrm
Check the following link for some useful exim commandsCode:exim -bpru|awk {'print $3'}|xargs exim -Mrm
http://www.togaware.com/linux/survivor/Exim.shtml
Or, you can simply ask a professional like chirpy to have your exim configured. His charges are very resonable. Search the forum and you'll see that sometimes he does it for free...
You are most welcome...bijo said:Well iquest :p Finally you did a great reply and i get a new information from you, One is the command and second one is the cron related (*/2). This post is really good and It is really appreciated![]()
FYI, that does not work.iquest said:Type this with root access:
then add the following linesCode:crontab -e
This will clear your mail queues in every two hours....Code:0 */2 * * * /scripts2/killeximq >/dev/null 2>&1
You obviously didn't read the whole thread:bmcpanel said:FYI, that does not work.
exiqgrep -zi -o 2592000 | xargs exim -Mrm
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | Create a Delete Email Cron Job? | 5 | ||
D | Anacron job 'cron.daily' - freshclam.log | 2 | ||
A | Cron Job auto delete emails older than X days in a domain | 6 | ||
A | cron job to delete emails received by X sender | 0 | ||
N | Need help with a delete /.Trash cron job on reseller hosting box | 0 |