Clarify legal basis and competence first.
Depending on the case, the Prison Act, criminal procedure, civil law and tenancy law interact. The prison does not automatically organise housing, mail or contracts. Contact rules and service of documents from detention require care.