Server side mail filtering

How do I do server side email filtering? I want to have emails delivered to subfolders based on header information. Is that possible?

Status: 
Closed (fixed)