Argument list too long means that * expands in too much files.
 
If you use bash, create an script like this
 
---------------------------cut here---------------------------
#!/bin/bash
 
cd DIRECTORYWITHMAILS   # The mailbox with spam
 
for   file in *; do
  # Do here whatever you like to do with each file for example
 
  sa-learn --spam $file
  rm -f $file
 
done
 
---------------------------cut here---------------------------
 
 
 
 
Cheers
 

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
                                     |
David Sanchez Martin                 |         [EMAIL PROTECTED]
Administrador de Sistemas            |       http://www.e2000.es
E2000 Nuevas Tecnologias             |
                                     |
E2000 Organizacion de Empresarios    |    Tel : +34 902 19 61 77
      Mediadores de Seguros          |
                                     |
Agustin Bravo Esquina Calle C        |
33120 Pravia Asturias Spain          |
                                     |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 


De: Shelly [mailto:[EMAIL PROTECTED]
Enviado el: martes, 31 de octubre de 2006 6:40
Para: [email protected]
Asunto: Re: [qmailtoaster] New Mailfilter

Hi Jake, Kyle and others,

Im trying to run a script on my box -

./spamscript: /root/.cpan/build/Mail-SpamAssassin-3.1.4/sa-learn: /usr/bin/perl: bad interpreter: Argument list too long

Does anyone have a solution so the script can run on large amounts of emails? Im trying to run it on about 990 emails and its bombing out, I expect to have more spam to run it on when the cron runs it.

Thanks

Jake Vickers <[EMAIL PROTECTED]> wrote:
Kyle Quillen wrote:
> How do I set that to look at all mail boxes would it be like this?
>
> #!/bin/sh
> find /home/vpopmail/domains/v2gnu.com/*/Maildir/cur/* -mtime +3 -exec
> rm -rf {} \;
> find /home/vpopmail/domains/v2gnu.com/*/Maildir/new/* -mtime +3 -exec
> rm -rf {} \;
>
How about something like this:

#!/bin/sh
locate Spam/ | grep -v S= | grep \/cur | uniq > /var/qmail/spam-folders
# moving to spam-clean file
# note: mtime is for how many days to leave the messages on the server
cat /var/qmail/spam-folders | awk '{print "find "$0"/ -type f -mtime 5
-exec rm -v {} \\; " };{ };{next}' > /var/qmail/spam-clean
sh /var/qmail/spam-clean



That's a quickly modified script that George had sent me a while back.

---------------------------------------------------------------------
QmailToaster hosted by: VR Hosted
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Send instant messages to your online friends http://au.messenger.yahoo.com

BEGIN:VCARD
VERSION:2.1
N:Sánchez Martín;David
FN:[EMAIL PROTECTED] ([EMAIL PROTECTED])
ORG:E2000 Financial Investments, S.A.;Centro de Nuevas Tecnologías
TITLE:Administrador de Sistemas
TEL;WORK;VOICE:902196177
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Agust=EDn Bravo 17 2=BA B=0D=0A33120 PRAVIA;Asturias;;;Espa=F1a
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Agust=EDn Bravo 17 2=BA B=0D=0A33120 PRAVIA=0D=0AAsturias=0D=0AEspa=F1a
URL;WORK:http://www.e2000.es
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20060705T152542Z
END:VCARD

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

Reply via email to