May this help:

http://blog.philippheckel.com/2008/05/16/roundcube-login-via-php-script/