I have successfully used the method below to configure the change_ldappass plugin of Squirrelmail to perform password strength checks using cracklib. I made a few assumptions, but it should be easy to adapt it to your own situation.
For example squirrelmail is custom installed, in /usr/share/squirrelmail/, using the newest stable version and I preferred to use php5, since it didn’t require a recompile. PHP4 on debian is not configured/compiled with the required extension. As a side effect this removed php4 which was fine to me, though it did require a slight configuration change here and there.