Managing mail forwarding


Is there a way to manage mail forwarding through telnet and subsequently php/perl or other language? How does DH manage them? Something akin to .forward files would be easy enough and accessible through a web-interface of my own design. I would like to give users of a subdomain email addresses and do not want to have to manage them myself. Couldn’t find anything on the wiki or in other posts. Thanks.