RE: Re: [qmailtoaster] Error Running qtp-clean-spam

2009-03-11 Thread Dan Page
I've dealt with this may times.  the best way is to use the find
command.  I use this by manually going into the spam folder and running
a small script.   I'll dig up the script in a few minutes but its
basically find . 'sudo vpopmail -H --spam []'  just be sure and run in
it in the directory you want it to delete the messages from.

I'll dig it up but that will handle them 1 at a time.  If anyone wants
to work on this I'd be willing to throw in some work on it.  The cron
script runs away on our older server since it can't finish in a hour and
after a few hours the machine runs out of memory and the phone starts
ringing.  

just my 2 cents but I think the script should:
have a limited memory/ cpu overhead usage built in (don't know how to do
this to a script)

Process mail 1 at a time so when you find an old email account with
2 spam it won't crash and die.  

Have some reporting features built in.  for example when it's run
manually it will say now cleaning spam for
f...@flintstone.com learned 27 messsages as spam moving to
wil...@flinstone.com learned 88 messages as spam...etc 

Dan

On Mon, 2008-12-08 at 16:35 -0700, Chris Hillman wrote:
 It seems to me the best way to fix the script for large amounts of
 work it to create a function in the shell script like this…
 
  
 
 function larger_mv ()
 
 {   while read line1; do
 
 md5sum directory/$line1   ~/md5sums
 
 ls -l directory/$line1  ~/backup_list
 
 mv directory/$line1 ../directory2
 
 done
 
 }
 
 ls -1 directory/ | larger_mv
 
 Example 3b demonstrates how you easily can get an md5sum and a backup
 listing of each file before moving it. 
 
 Unfortunately, since this method also requires that each file be dealt
 with individually, it will involve a delay similar to that of Method
 #2. From experience I have found that Method #2 is a little faster
 than the function given in Example 3a, so Method #3 should be used
 only in cases where the extra functionality is required.
 
 Taken from http://www.linuxjournal.com/article/6060
 
  
 
  
 
 From: Kyle Quillen [mailto:kquil...@corp.wifi7.com] 
 Sent: Monday, December 08, 2008 4:24 PM
 To: qmailtoaster-list@qmailtoaster.com
 Subject: RE: Re: [qmailtoaster] Error Running qtp-clean-spam
 
 
  
 
 Eric,
 
 
  
 
 
 Thanks for the quick script 
 
 
  
 
 
 it threw this error..
 
 
  
 
 
 cleanspam.sh: line 14: /bin/ls: Argument list too long
 
 
  
 
 
  
 
 
 Is there a command that we can run to just delete these without
 pumping them into sa-learn
 
 
  
 
 
 Thanks
 
 
 Q
 
 
  
 

 __
 From: news on behalf of Eric Shubert
 Sent: Mon 12/8/2008 4:46 PM
 To: qmailtoaster-list@qmailtoaster.com
 Subject: Re: [qmailtoaster] Error Running qtp-clean-spam
 
 
 That script really should be fixed. In the meantime, this should work:
 (substitute mydomain appropriately)
 
 for maildir in `ls -d /home/vpopmail/domains/mydomain/*/Maildir`; do
shopt -s extglob
for spamfile in `find $maildir/+(cur|new)/* 2/dev/null`; do
  sudo -u vpopmail -H sa-learn --$learnas $spamfile
  rc=$?
  if [ $? != 0 ]; then
echo sa-learn failed, rc=$rc, spamfile=$spamfile
exit $rc
  fi
  rm $spamfile
done
 done
 
 Please report back your result.
 
 Kyle Quillen wrote:
  Well there are about 3000 accounts on this server so it is going to
 be pretty hard to drill down which folder it is bombing on
  
  thanks
  q
  
 
  
 
  From: Chris Hillman [mailto:chill...@clearwater-research.com]
  Sent: Mon 12/8/2008 1:49 PM
  To: qmailtoaster-list@qmailtoaster.com
  Subject: RE: [qmailtoaster] Error Running qtp-clean-spam
 
 
 
  Rather than modify the script, just create a temp imap folder...
 'temp-spam' or something and move half of the messages there
 temporarily. Run the script. After completion move them back and run
 again.  Hopefully it will complete successfully.
 
  
 
  -Chris
 
  
 
  From: Kyle Quillen [mailto:kquil...@corp.wifi7.com]
  Sent: Monday, December 08, 2008 11:41 AM
  To: qmailtoaster-list@qmailtoaster.com
  Subject: RE: [qmailtoaster] Error Running qtp-clean-spam
 
  
 
  any insight on how to modify the script?  I do not know scripting
 all that well and don't want to botch things
 
  
 
  Thanks
 
  Q
 
  
 
  
 
  
 
  From: Jake Vickers [mailto:j...@v2gnu.com]
  Sent: Mon 12/8/2008 1:36 PM
  To: qmailtoaster-list@qmailtoaster.com
  Subject: Re: [qmailtoaster] Error Running qtp-clean-spam
 
  Kyle Quillen wrote:
 
  Hello all,
 
  
 
  When I try to run the qtp-clean-spam script it comes back with an
 error message that finds argument list is too long.  Can anyone point
 in a direction as to how to clear this up. 
 
 
  You have too many messages in one folder - you can either break the
 messages up into 2 directories and learn them

Re: [qmailtoaster] Error Running qtp-clean-spam

2009-03-11 Thread Eric Shubert
The script does use the find command, Dan. There was a bug in it though 
that prevented it's proper use (the variable containing the list of 
files was errantly quoted, so the rm command was still being passed all 
names at once). The script has been fixed, and was checked into the qtp 
repo about a week ago. It will be in the next QTP release.


In the meantime, please grab it from the repo before spending time 
re-fixing it. I think that you might find the other features aren't 
really necessary with the present version.


Dan Page wrote:

I've dealt with this may times.  the best way is to use the find
command.  I use this by manually going into the spam folder and running
a small script.   I'll dig up the script in a few minutes but its
basically find . 'sudo vpopmail -H --spam []'  just be sure and run in
it in the directory you want it to delete the messages from.

I'll dig it up but that will handle them 1 at a time.  If anyone wants
to work on this I'd be willing to throw in some work on it.  The cron
script runs away on our older server since it can't finish in a hour and
after a few hours the machine runs out of memory and the phone starts
ringing.  


just my 2 cents but I think the script should:
have a limited memory/ cpu overhead usage built in (don't know how to do
this to a script)

Process mail 1 at a time so when you find an old email account with
2 spam it won't crash and die.  


Have some reporting features built in.  for example when it's run
manually it will say now cleaning spam for
f...@flintstone.com learned 27 messsages as spam moving to
wil...@flinstone.com learned 88 messages as spam...etc 


Dan

On Mon, 2008-12-08 at 16:35 -0700, Chris Hillman wrote:

It seems to me the best way to fix the script for large amounts of
work it to create a function in the shell script like this…

 


function larger_mv ()

{   while read line1; do

md5sum directory/$line1   ~/md5sums

ls -l directory/$line1  ~/backup_list

mv directory/$line1 ../directory2

done

}

ls -1 directory/ | larger_mv

Example 3b demonstrates how you easily can get an md5sum and a backup
listing of each file before moving it. 


Unfortunately, since this method also requires that each file be dealt
with individually, it will involve a delay similar to that of Method
#2. From experience I have found that Method #2 is a little faster
than the function given in Example 3a, so Method #3 should be used
only in cases where the extra functionality is required.

Taken from http://www.linuxjournal.com/article/6060

 

 

From: Kyle Quillen [mailto:kquil...@corp.wifi7.com] 
Sent: Monday, December 08, 2008 4:24 PM

To: qmailtoaster-list@qmailtoaster.com
Subject: RE: Re: [qmailtoaster] Error Running qtp-clean-spam


 


Eric,


 



Thanks for the quick script 



 



it threw this error..


 



cleanspam.sh: line 14: /bin/ls: Argument list too long


 



 



Is there a command that we can run to just delete these without
pumping them into sa-learn


 



Thanks


Q


 

   
__

From: news on behalf of Eric Shubert
Sent: Mon 12/8/2008 4:46 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam


That script really should be fixed. In the meantime, this should work:
(substitute mydomain appropriately)

for maildir in `ls -d /home/vpopmail/domains/mydomain/*/Maildir`; do
   shopt -s extglob
   for spamfile in `find $maildir/+(cur|new)/* 2/dev/null`; do
 sudo -u vpopmail -H sa-learn --$learnas $spamfile
 rc=$?
 if [ $? != 0 ]; then
   echo sa-learn failed, rc=$rc, spamfile=$spamfile
   exit $rc
 fi
 rm $spamfile
   done
done

Please report back your result.

Kyle Quillen wrote:

Well there are about 3000 accounts on this server so it is going to

be pretty hard to drill down which folder it is bombing on

thanks
q




From: Chris Hillman [mailto:chill...@clearwater-research.com]
Sent: Mon 12/8/2008 1:49 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam



Rather than modify the script, just create a temp imap folder...

'temp-spam' or something and move half of the messages there
temporarily. Run the script. After completion move them back and run
again.  Hopefully it will complete successfully.



-Chris



From: Kyle Quillen [mailto:kquil...@corp.wifi7.com]
Sent: Monday, December 08, 2008 11:41 AM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam



any insight on how to modify the script?  I do not know scripting

all that well and don't want to botch things



Thanks

Q







From: Jake Vickers [mailto:j...@v2gnu.com]
Sent: Mon 12/8/2008 1:36 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running

Re: [qmailtoaster] Error Running qtp-clean-spam

2009-03-03 Thread Eric Shubert
This fix has been checked into the qtp repository and will be included 
in the next release. If you need it before hand you can find 
/etc/cron.hourly/qtp-clean-spam in the repo at 
http://qtp.qmailtoaster.com. Just browse the source!


Eric Shubert wrote:

Thanks, Kyle. I'll put the fix in the next qtp release.

Kyle Quillen wrote:

I think the last email fixed the issue.
 
Much thanks

Q
 




From: news on behalf of Eric Shubert
Sent: Mon 12/8/2008 6:55 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam



Kyle Quillen wrote:

Hello all,

When I try to run the qtp-clean-spam script it comes back with an error
message that finds argument list is too long.  Can anyone point in a
direction as to how to clear this up.

Thanks
Q



Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest
modification date)?
Which vertion of qmailtoaster-plus?

--
-Eric 'shubes'





--
-Eric 'shubes'


-
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com



Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-10 Thread Eric Shubert

Thanks, Kyle. I'll put the fix in the next qtp release.

Kyle Quillen wrote:

I think the last email fixed the issue.
 
Much thanks

Q
 




From: news on behalf of Eric Shubert
Sent: Mon 12/8/2008 6:55 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam



Kyle Quillen wrote:

Hello all,

When I try to run the qtp-clean-spam script it comes back with an error
message that finds argument list is too long.  Can anyone point in a
direction as to how to clear this up.

Thanks
Q



Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest
modification date)?
Which vertion of qmailtoaster-plus?

--
-Eric 'shubes'


-
 QmailToaster hosted by: VR Hosted http://www.vr.org http://www.vr.org/ 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
-Eric 'shubes'


-
QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-09 Thread Kyle Quillen
I think the last email fixed the issue.
 
Much thanks
Q
 



From: news on behalf of Eric Shubert
Sent: Mon 12/8/2008 6:55 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam



Kyle Quillen wrote:
 Hello all,
 
 When I try to run the qtp-clean-spam script it comes back with an error
 message that finds argument list is too long.  Can anyone point in a
 direction as to how to clear this up.
 
 Thanks
 Q
 

Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest
modification date)?
Which vertion of qmailtoaster-plus?

--
-Eric 'shubes'


-
 QmailToaster hosted by: VR Hosted http://www.vr.org http://www.vr.org/ 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



winmail.dat-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Jake Vickers

Kyle Quillen wrote:

Hello all,
 
When I try to run the qtp-clean-spam script it comes back with an 
error message that finds argument list is too long.  Can anyone point 
in a direction as to how to clear this up. 


You have too many messages in one folder - you can either break the 
messages up into 2 directories and learn them that way, or modify the 
script to use another find command to pipe the output to the sa-learn 
command.




RE: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Chris Hillman
Rather than modify the script, just create a temp imap folder...
'temp-spam' or something and move half of the messages there
temporarily. Run the script. After completion move them back and run
again.  Hopefully it will complete successfully.

 

-Chris

 

From: Kyle Quillen [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 11:41 AM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam

 

any insight on how to modify the script?  I do not know scripting all
that well and don't want to botch things

 

Thanks

Q

 

 



From: Jake Vickers [mailto:[EMAIL PROTECTED]
Sent: Mon 12/8/2008 1:36 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam

Kyle Quillen wrote: 

Hello all,

 

When I try to run the qtp-clean-spam script it comes back with an error
message that finds argument list is too long.  Can anyone point in a
direction as to how to clear this up.  


You have too many messages in one folder - you can either break the
messages up into 2 directories and learn them that way, or modify the
script to use another find command to pipe the output to the sa-learn
command.



RE: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Kyle Quillen
Well there are about 3000 accounts on this server so it is going to be pretty 
hard to drill down which folder it is bombing on 
 
thanks
q
 



From: Chris Hillman [mailto:[EMAIL PROTECTED]
Sent: Mon 12/8/2008 1:49 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam



Rather than modify the script, just create a temp imap folder... 'temp-spam' or 
something and move half of the messages there temporarily. Run the script. 
After completion move them back and run again.  Hopefully it will complete 
successfully.

 

-Chris

 

From: Kyle Quillen [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 11:41 AM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam

 

any insight on how to modify the script?  I do not know scripting all that well 
and don't want to botch things

 

Thanks

Q

 

 



From: Jake Vickers [mailto:[EMAIL PROTECTED]
Sent: Mon 12/8/2008 1:36 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam

Kyle Quillen wrote: 

Hello all,

 

When I try to run the qtp-clean-spam script it comes back with an error message 
that finds argument list is too long.  Can anyone point in a direction as to 
how to clear this up.  


You have too many messages in one folder - you can either break the messages up 
into 2 directories and learn them that way, or modify the script to use another 
find command to pipe the output to the sa-learn command.

winmail.dat-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Eric Shubert

That script really should be fixed. In the meantime, this should work:
(substitute mydomain appropriately)

for maildir in `ls -d /home/vpopmail/domains/mydomain/*/Maildir`; do
  shopt -s extglob
  for spamfile in `find $maildir/+(cur|new)/* 2/dev/null`; do
sudo -u vpopmail -H sa-learn --$learnas $spamfile
rc=$?
if [ $? != 0 ]; then
  echo sa-learn failed, rc=$rc, spamfile=$spamfile
  exit $rc
fi
rm $spamfile
  done
done

Please report back your result.

Kyle Quillen wrote:
Well there are about 3000 accounts on this server so it is going to be pretty hard to drill down which folder it is bombing on 
 
thanks

q
 




From: Chris Hillman [mailto:[EMAIL PROTECTED]
Sent: Mon 12/8/2008 1:49 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam



Rather than modify the script, just create a temp imap folder... 'temp-spam' or 
something and move half of the messages there temporarily. Run the script. 
After completion move them back and run again.  Hopefully it will complete 
successfully.

 


-Chris

 

From: Kyle Quillen [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 11:41 AM

To: qmailtoaster-list@qmailtoaster.com
Subject: RE: [qmailtoaster] Error Running qtp-clean-spam

 


any insight on how to modify the script?  I do not know scripting all that well 
and don't want to botch things

 


Thanks

Q

 

 




From: Jake Vickers [mailto:[EMAIL PROTECTED]
Sent: Mon 12/8/2008 1:36 PM
To: qmailtoaster-list@qmailtoaster.com
Subject: Re: [qmailtoaster] Error Running qtp-clean-spam

Kyle Quillen wrote: 


Hello all,

 

When I try to run the qtp-clean-spam script it comes back with an error message that finds argument list is too long.  Can anyone point in a direction as to how to clear this up.  



You have too many messages in one folder - you can either break the messages up 
into 2 directories and learn them that way, or modify the script to use another 
find command to pipe the output to the sa-learn command.





-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
-Eric 'shubes'


-
QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Eric Shubert

Kyle Quillen wrote:

Hello all,
 
When I try to run the qtp-clean-spam script it comes back with an error 
message that finds argument list is too long.  Can anyone point in a 
direction as to how to clear this up. 
 
Thanks

Q
 


Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest 
modification date)?

Which vertion of qmailtoaster-plus?

--
-Eric 'shubes'


-
QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Kyle Quillen
Kyle Quillen wrote:
 Hello all,
 
 When I try to run the qtp-clean-spam script it comes back with an error
 message that finds argument list is too long.  Can anyone point in a
 direction as to how to clear this up.
 
 Thanks
 Q
 

Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest
modification date)?
Which vertion of qmailtoaster-plus?
-Eric 'shubes'



Eric,

This is the error that I get 

qtp-clean-spam: line 45: /usr/bin/find: Argument list too long

9-2-08 is the last comments in my file.

 

Thanks

Q

 

 

 

 


-
 QmailToaster hosted by: VR Hosted http://www.vr.org http://www.vr.org/ 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


winmail.dat-
 QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [qmailtoaster] Error Running qtp-clean-spam

2008-12-08 Thread Eric Shubert

Kyle Quillen wrote:

Kyle Quillen wrote:

Hello all,

When I try to run the qtp-clean-spam script it comes back with an error
message that finds argument list is too long.  Can anyone point in a
direction as to how to clear this up.

Thanks
Q



Does the error tell which line in the script gets the error?
Which version of qtp-clean-spam are you running (what's the latest
modification date)?
Which vertion of qmailtoaster-plus?
-Eric 'shubes'

Eric,

This is the error that I get 


qtp-clean-spam: line 45: /usr/bin/find: Argument list too long

9-2-08 is the last comments in my file.

 


Thanks

Q


I think I see the problem. Try changing
for each in ${PATH_SPAM} ; do
to
for each in ${PATH_SPAM} ; do
(remove the quotes)
I'm betting that'll fix it. Let me know and I'll get the script fixed 
for the next qtp release.


--
-Eric 'shubes'


-
QmailToaster hosted by: VR Hosted http://www.vr.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]