Just in case anyone needs this in the future:
I managed to get round it by setting the configuration as:
$rcmail_config['db_dsnw'] = array('phptype'=>'mysql','username'=>'username','password'=>'password','protocol' => 'unix', 'hostspec' => 'host', 'socket' => 'socket location', 'database' => 'database');