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? |
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.
|
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 /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 |
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.) |
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. |
All times are GMT -5. The time now is 05:33 AM. |