Procmail is a powerful and robust set of tools that enable you to automatically process mail as you receive it, or after it is already in a message folder.