I would say your best bet would be to look on
www.tldp.org
I am sure there is some documentation for the scenario you are describing above.
off the top of my head though...you will probably need to use fetchmail with spamassasin and then procmail to deliver the mail to the various user account(does fetchmail do this...maybe...).