General determination of phases in leptonic mass matrices