| Email General questions, webmail, mailing lists. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#28 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
![]() And yes, I will enjoy my holiday! Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#29 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Oct 2005
Lives in Jacksonville, FL
Hosted on PASS44
1 posts
Gave thanks: 0
Thanked 2 times
|
Here is updated learnspam script that uses xargs to work around kernel limitations that cause the "Argument list too long". Xargs will take as many of the arguments and pass them to the indicated commands until all of the arguments are exhausted.
![]() Attachment: learnspam.txt Code:
Running jicoweb.com spam assassin training script
JicoScript learnspam script 0.6.20070609
SpamAssassin version 3.2.3
Currently running as user: *****
Checking spam and ham repositories exist...
/home/*****/spamdb exists!
/home/*****/hamdb exists!
Learning from SPAM
/home/*****/mail/*****/*****/.spam
learning from spam ...
Learned tokens from 55 message(s) (142 message(s) examined)
Learned tokens from 65 message(s) (142 message(s) examined)
Learned tokens from 38 message(s) (142 message(s) examined)
Learned tokens from 49 message(s) (142 message(s) examined)
Learned tokens from 54 message(s) (142 message(s) examined)
Learned tokens from 55 message(s) (142 message(s) examined)
Learned tokens from 53 message(s) (142 message(s) examined)
Learned tokens from 42 message(s) (142 message(s) examined)
Learned tokens from 50 message(s) (142 message(s) examined)
Learned tokens from 45 message(s) (142 message(s) examined)
Learned tokens from 54 message(s) (142 message(s) examined)
Learned tokens from 57 message(s) (142 message(s) examined)
Learned tokens from 54 message(s) (142 message(s) examined)
Learned tokens from 40 message(s) (142 message(s) examined)
Learned tokens from 39 message(s) (83 message(s) examined)
not enough old spam!!
Learning from uncaught SPAM
/home/*****/mail/*****/*****/.learnspam
no spam messages to learn from!!
Learning HAM
/home/*****/mail/*****/*****/.ham
no ham messages to learn from!!
Synchronising spam database
bayes: synced databases from journal in 8 seconds: 129168 unique entries (129168
total entries)
Done
__________________
OC10 on PASS44 PKC Hosting | Boy Scout Troop 821 | Cub Scout Pack 821 | Oglala Chapter |
|
|
|
| These users thank pcannon for this great post! | jdcopelin (August 25th, 2007), pseudoswede (August 28th, 2007) |
|
|
#30 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
Cheers, Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#31 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
|
Excellent work, pcannon!
I'm still looking for a solution to delete learned/archived spams that are older than 30 days. Right now, they get learned, then just sit in the SPAMDB folder hogging up space.
__________________
"In the end, everything will be fine - if it is not fine, it is not the end." PseudoSwedelarvez.com Dime9 |
|
|
|
|
|
#32 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
The code below should do what you want, insert it in the space above the "Synchronising spam database" section towards the very bottom of the script. The code will clean out the spam and ham archives. Code:
echo ""
echo "Cleaning out SPAM archive"
SPAM_FILES=`find $SPAMDIR -name \* -mtime +30 -type f`
QUANTITY=`echo $SPAM_FILES | wc -w`
if [ $QUANTITY -lt 1 ]
then
echo -e "\t\tnot enough old archived spam to clean out!!"
else
echo -n -e "\t\t"
echo $SPAM_FILES | xargs rm -f
fi
echo ""
echo "Cleaning out HAM archive"
HAM_FILES=`find $HAMDIR -name \* -mtime +30 -type f`
QUANTITY=`echo $HAM_FILES | wc -w`
if [ $QUANTITY -lt 1 ]
then
echo -e "\t\tnot enough old archived ham to clean out!!"
else
echo -n -e "\t\t"
echo $HAM_FILES | xargs rm -f
fi
__________________
Server: Pass32 and dedicated server Last edited by jdcopelin; August 28th, 2007 at 5:20 PM.. Reason: added to the code posted |
|
|
|
|
| This user thanks jdcopelin for this great post! | pseudoswede (August 29th, 2007) |
|
|
#33 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Feb 2006
Lives in Oklahoma
Hosted on pass80
18 posts
Gave thanks: 3
Thanked 0 times
|
What am I doing wrong to get this error below:
Thanks, /home/****/mail/****.com/******/.spam learning from spam ... ERROR: the Bayes learn function returned an error, please re-run with -D for more information Learned tokens from 0 message(s) (1 message(s) examined) xargs: sa-learn: exited with status 255; aborting not enough old spam!!
__________________
vcsok.com Server reseller pass80 ![]() |
|
|
|
|
|
#34 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Quote:
Assuming that you are on a shared server... Create a new script file adding execute permissions and paste the code below into it: Code:
#!/bin/sh sa-learn -D If you are on a dedicated server make sure you aren't running the learning script as root, or that you aren't running as a normal user and trying to train other users bayes databases. They all cause permission issues. Regards Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#35 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Feb 2006
Lives in Oklahoma
Hosted on pass80
18 posts
Gave thanks: 3
Thanked 0 times
|
Here is what I got:
Please select either --spam, --ham, --folders, --forget, --sync, --import, --dump, --clear, --backup or --restore Usage: sa-learn [options] [file]... sa-learn [options] --dump [ all | data | magic ] Options: --ham Learn messages as ham (non-spam) --spam Learn messages as spam --forget Forget a message --use-ignores Use bayes_ignore_from and bayes_ignore_to --sync Syncronize the database and the journal if needed --force-expire Force a database sync and expiry run --dbpath <path> Allows commandline override (in bayes_path form) for where to read the Bayes DB from --dump [all|data|magic] Display the contents of the Bayes database Takes optional argument for what to display --regexp <re> For dump only, specifies which tokens to dump based on a regular expression. -f file, --folders=file Read list of files/directories from file --dir Ignored; historical compatibility --file Ignored; historical compatibility --mbox Input sources are in mbox format --mbx Input sources are in mbx format --showdots Show progress using dots --progress Show progress using progress bar --no-sync Skip synchronizing the database and journal after learning -L, --local Operate locally, no network accesses --import Migrate data from older version/non DB_File based databases --clear Wipe out existing database --backup Backup, to STDOUT, existing database --restore <filename> Restore a database from filename -u username, --username=username Override username taken from the runtime environment, used with SQL -C path, --configpath=path, --config-file=path Path to standard configuration dir -p prefs, --prefspath=file, --prefs-file=file Set user preferences file --siteconfigpath=path Path for site configs (default: /etc/mail/spamassassin) --cf='config line' Additional line of configuration -D, --debug [area=n,...] Print debugging messages -V, --version Print version -h, --help Print usage message SpamAssassin version 3.2.3
__________________
vcsok.com Server reseller pass80 ![]() |
|
|
|
|
|
#36 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
|
Quote:
![]()
__________________
"In the end, everything will be fine - if it is not fine, it is not the end." PseudoSwedelarvez.com Dime9 |
|
|
|
|