I use the passwd module from horde. Has worked quite nicely for me in combination with poppasswd and smbpasswd. See the relevant section in http://www.geocities.com/oliversl/imp/#5_Configuring_IMP Fletch.