| Email General questions, webmail, mailing lists. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#19 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
|
Another thing...
How can I have this script automagically remove spam that is older than, say, 30 days? Thanks in advance.
__________________
"In the end, everything will be fine - if it is not fine, it is not the end." PseudoSwedelarvez.com Dime9 |
|
|
|
|
|
#20 (permalink) | |||
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
167 posts
Gave thanks: 23
Thanked 19 times
|
Hello,
Thanks for trying out my script. I will try to answer your questions. Quote:
Quote:
Quote:
Code:
SPAM_FILES=`find $SPAMFOLDER/cur -name \*, -mtime +7 -type f` If you don't want to archive the files, then change the line of code a few lines down from 85 Code:
mv -f --target-directory=$SPAMDIR $SPAM_FILES Code:
rm $SPAM_FILES Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|||
|
|
|
|
|
#21 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
|
Thanks for the help.
It kind of worked, but I do have two error messages... Code:
Running jicoweb.com spam assassin training script
JicoScript learnspam script 0.6.20070609
SpamAssassin version 3.2.2
Currently running as user: ****
Checking spam and ham repositories exist...
/home/****/spamdb exists!
/home/****/hamdb exists!
Learning from SPAM
/home/****/mail/****/mailtrap/.SPAM
learning from spam ...
Learned tokens from 0 message(s) (2 message(s) examined)
learning from old spam ...
/home/****/script/learnspam: /usr/bin/sa-learn: /usr/bin/perl: bad
interpreter: Argument list too long
/home/****/script/learnspam: line 94: /bin/mv: Argument list too long
/home/****/mail/****/innebandy/.SPAM
learning from spam ...
Learned tokens from 351 message(s) (365 message(s) examined)
learning from old spam ...
Learned tokens from 14 message(s) (14 message(s) examined)
Learning from uncaught SPAM
/home/****/mail/****/mailtrap/.SPAM
learning from messages ...
/home/****/script/learnspam: /usr/bin/sa-learn: /usr/bin/perl: bad
interpreter: Argument list too long
/home/****/script/learnspam: line 119: /bin/mv: Argument list too long
/home/****/mail/****/innebandy/.SPAM
learning from messages ...
Learned tokens from 1 message(s) (1 message(s) examined)
Learning HAM
Synchronising spam database
bayes: synced databases from journal in 0 seconds: 154 unique entries (154 total
entries)
expired old bayes database entries in 19 seconds
157777 entries kept, 0 deleted
token frequency: 1-occurrence tokens: 71.65%
token frequency: less than 8 occurrences: 18.03%
Done
There are probably around 1000 spams that are older than 30 days in that folder. The line(s) in question are.. Code:
mv -f --target-directory=$SPAMDIR $SPAM_FILES
__________________
"In the end, everything will be fine - if it is not fine, it is not the end." PseudoSwedelarvez.com Dime9 Last edited by pseudoswede; August 2nd, 2007 at 5:49 PM.. Reason: my grammar ain't so good |
|
|
|
|
|
#22 (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:
Oh no! That looks like a bug in my script (or limitation of how many files you can pass as a parameter in the command shell). Unfortunately my home PC has just suffered a hard drive failure so I don't have access to any of my files right now to investigate this and fix it. As soon as it is fixed, I will look into this for you. Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
| This user thanks jdcopelin for this great post! | pseudoswede (August 3rd, 2007) |
|
|
#23 (permalink) |
|
Surpass Fan
Comfy Contributor
Joined in Jun 2003
Lives in Denver
Hosted on D9
142 posts
Gave thanks: 4
Thanked 3 times
|
I'm a software tester by trade, so I like to break things. Whether on purpose or accidentally.
![]() Unfortunately, I'm not a developer, so I can't fix them. ![]() Thanks for your help, I appreciate it.
__________________
"In the end, everything will be fine - if it is not fine, it is not the end." PseudoSwedelarvez.com Dime9 Last edited by pseudoswede; August 3rd, 2007 at 6:57 PM.. |
|
|
|
|
|
#24 (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:
![]() Anyway, I have done some more testing and the only way around the command line arguments limit that I can find will make the whole script grossly inefficient. If you know BASH scripting I think the only way would be to call sa-learn and mv individually for each maildir message file that the "find" command lists? That will definitely slow the script down. I think I can reduce the files sent to sa-learn by using grep to filter out spam already learnt as spam (assuming false negatives and caught spam are kept in the same folder). Any comments are welcome! Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#25 (permalink) |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Does the Spam Assassin WIKI help this process at all?
http://wiki.apache.org/spamassassin/BayesInSpamAssassin We've gone from a 10 line simple, efficient script on MBOX to a convoluted mess of code due to maildir...*sigh*
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|
|
#26 (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:
I am about to go on holiday so won't be reading the forum for about a fortnight, but when I get back I will look through older scripts I based on Cowboys MBOX version and post it here. Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#27 (permalink) | |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Quote:
Enjoy your holiday!
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|