# Mail filtering question

## MathFreak

My current setup is fetchmail, procmail, exim, and courier-imapd, using either mutt or squirrelmail to check my mail via imap.  The thing is, I want to sort my incoming messages to different folders.  Squirrelmail can do this, but I can't find a way to do this with mutt.  Is it possible for procmail to send it to a specific folder?  Woudl a different setup make it easier?  Any suggestions would be welcome.

----------

## klieber

 *MathFreak wrote:*   

> Is it possible for procmail to send it to a specific folder?

 

Yes, absolutely.  There's lots of procmail-related resources out there.  Try searching google.  Or, look at the procmail home page and/or mailing list archives

--kurt

----------

## Damasz

http://www.stimpy.net/procmail/tutorial/

I found this tutorial to be very useful, check it out!

----------

## MathFreak

Actually, it turns out my problem was with my maildir format.  Under each folder are three more folders - cur, new, and tmp.  I had to put the message under .folder/new for it to be seen by the mail clients.

----------

## mglauche

another good sollution is the cyrus imapd. it has the very powerfull sieve mail filtering language build in (its even some rfc now  :Wink: 

its also quite easy to learn:

i.e.:

```

require "fileinto";

if header :is "X-Spam-Flag" "yes" {

   fileinto "INBOX.spam";

}

```

would filter my spamassasin-tagged emails into a subfolder.

----------

