Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Spam checking of old mail?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
lotas
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2002
Posts: 121
Location: Tallaght, Dublin, Ireland

PostPosted: Mon Jan 27, 2003 4:49 pm    Post subject: Spam checking of old mail? Reply with quote

Im just after finding the tip in the Gentoo newsletter very handy. The spam fighting tip that is. I have a large mail box at the moment (300MB+ and about 16000 emails, im too lazy to delete stuff). anyway, i can now check new mail to see if its spam, but is there a quick way to check old mail? i know there is some spam in there now, i just dont want to go though each email to find it! also im using imapd and mozilla mail. is there a way to filter different emails to folders so mozilla can read them?
Thanks in advance.
_________________
Lotas T Smartman
www.lotas-smartman.net
www.the-hairy-one.com
www.lsn-blog.tk
Dual Athlon 2Gz, 1Gb ram, 120Gb hdd, GeForce FX5200, DVD+R/-R/+RW/-RW, CDR/RW
Back to top
View user's profile Send private message
barran
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 142
Location: Århus, DK

PostPosted: Mon Jan 27, 2003 5:04 pm    Post subject: Reply with quote

Code:
formail  -a X-Spamcheck: yes -s mail user@domain.tld < mailbox

And put this in your .procmailrc:
Code:
DEFAULT=/home/${LOGNAME}/Mail

:0fw
| /usr/bin/spamc

:0:
* X-Spam-Status: Yes
spam

:0:
* X-Spamcheck: yes
spamchecked

And if you don't have the mail command:
Code:
emerge mailx

Warning: I haven't tested this.
I hope it is what you wanted.

EDIT: added DEFAULT var to procmailrc


Last edited by barran on Mon Jan 27, 2003 5:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
lotas
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2002
Posts: 121
Location: Tallaght, Dublin, Ireland

PostPosted: Mon Jan 27, 2003 5:15 pm    Post subject: Reply with quote

well, only problem is that that will cause a loop. the maildir i have is where all my mail is stored. when new mail comes in, it goes to /home/lotas/.maildir/ and all the mail i want to check is there. if i put in the code you have listed, it will check mail in that dir, send it back to me, and back to that dir, check it, etc. Its currently about 600mb now, and i tried it. cat told me:
Code:
bash: /bin/cat: Argument list too long
.
hmmm. any other ideas? i forgot to mention its a mail dir, not an mbox. sorry.
_________________
Lotas T Smartman
www.lotas-smartman.net
www.the-hairy-one.com
www.lsn-blog.tk
Dual Athlon 2Gz, 1Gb ram, 120Gb hdd, GeForce FX5200, DVD+R/-R/+RW/-RW, CDR/RW
Back to top
View user's profile Send private message
barran
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 142
Location: Århus, DK

PostPosted: Mon Jan 27, 2003 5:28 pm    Post subject: Reply with quote

it does not create a mailloop if you make your .procmailrc what I wrote above.

This is how it goes.
Code:
cat .maildir/cur/* | formail -a X-Spamcheck: yes -s mail me

This will ad an X-Spamcheck header to all the mails in the mailbox.
Now make your procmailrc as above.
Now all spam will be saved in spam and all which is not spam will be saved in spamchecked. If you want to save into a dir the just replace spamchecked with spamchecked/

Now you can do:
Code:
mv spamchecked/ .maildir/


EDIT: Oh remember to have an DEFAULT=/home/${LOGNAME}/Mail in top of the .procmailrc and do a mkdir -p /home/${LOGNAME}/Mail
then spam and spamchecked/ will appear in the Mail dir
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum