LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-05-2003, 07:08 AM   #1
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
Sorting mail into folders?


I have just gotten spamassassin working on one of my servers and it is working great, I have it for right now just changing the title of the messages to [SPAM] so I can see which ones it is marking. What I would like to do now is have any messages it marks as spam be put into a spam imap folder. All the users on this server are using squirrelmail to check their mail so haveing a spam folder would be ideal. My problem is I do not know where to start on doing that, which program would do the sorting?

These are the programs I am useing for mail

qmail
vpopmail
courier-imap
qmail-scanner
clamscan
spamassassin

At first I thought that spamassassin should do the sorting into different folders but now I don't think it is its job but what program is it that would do that?

Can any of the above programs sort any messages with [SPAM] in the title to a spam mailbox for that user? And how would I do that?
 
Old 11-05-2003, 07:38 AM   #2
nhs
Member
 
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
At some point your setup will call procmail. Edit your ~/.procmailrc file to a spam folder when the headers match 'Subject: .*\[SPAM\].*'. You will need to read the procmailrc man page as I can't remember the precise syntax at the moment.
 
Old 11-07-2003, 09:43 AM   #3
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Original Poster
Rep: Reputation: 30
Thank you for your response, I have spent the last couple of days trying to get it all to work together. I finally got it to work and wanted to reply back with how I did it as this seems to not be very documented on the web.

I setup my mail server very similar to the guide here:
http://www.pipeline.com.au/staff/mbo...ail-server.htm

I did the spamassassin and clam antivirus checking, this was working very good for finding the messages that were spam but I wanted to filter any message that started with [SPAM] into a spam imap folder.

I am useing vpopmail so it is not the regular setup but I used procmail like was said above and put the following two files in.

/home/vpopmail/goober.com/marcus/Maildir/procmailrc

The contents were:
Code:
### Spam Assassin
:0fw
| /usr/bin/spamassassin -P

:0e
{
   EXITCODE=$?
}

### Toss Spam into a Folder
:0:
* ^Subject:.*\[SPAM\].*
/home/vpopmail/domains/goober.com/marcus/Maildir/.spam/

### Deliver the rest into Maildir normally
:0
*
/home/vpopmail/domains/goober.com/marcus/Maildir/
And then I called that file from the following file:
/home/vpopmail/domains/goober.com/.qmail-marcus

The contents of that file were:
Code:
| preline procmail -t /home/vpopmail/domains/goober.com/marcus/Maildir/procmailrc
After I made those two files it now sorts all the messages marked as spam to the spam imap folder. Now my next project is to delete any messages that are over 7 days old in that spam box from a cron job. If I get that I will post that here as well.
 
Old 11-07-2003, 10:02 AM   #4
evil_Tak
Member
 
Registered: Oct 2003
Distribution: Debian/unstable
Posts: 85

Rep: Reputation: 15
If you're using courier-imap, you're probably also using courier maildrop? If so, maildrop has a builtin facility for filtering based on per-Maildir config files.

I have a similar setup - postfix+courier-imap+courier-maildrop, and several of my users use my squirrelmail interface. (I don't really have any custom spam checkers, because my global maildrop filter catches 99% of the spam anyway.)
 
Old 11-07-2003, 10:20 AM   #5
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Original Poster
Rep: Reputation: 30
I may find a better way of doing it, but for now that will do the job, I am going to program a custom interface later where users can set their spam settings, and a bunch of stuff but until then I will just do it the way I said above.

This project started out as just scanning for virus's but when I was looking it looked like I could also do spam filtering with just a little more setup so I went for the whole thing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to backup / restore mail folders i_s Linux - General 1 04-23-2005 02:05 PM
procmail mail sorting FLOODS Linux - Networking 1 11-26-2004 09:12 PM
Mozzilla mail erased my folders griev Linux - Newbie 1 09-06-2004 12:45 PM
Sorting mp3s into folders by ID3 tags? deadjoebob Linux - Software 0 03-07-2004 12:21 PM
sorting my mail after fetchmail has got it. kudos Linux - General 3 01-04-2003 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration