  Metal-organic frameworks comprehend a wide class of hybrid organic-inorganic
materials with general structure A$_m$BX$_n$, with $A$ and $X$ being organic
molecules and B a metal cation. This often results in enhanced structural
flexibility and new functionalities. Hybrid perovskites ABX$_3$ are a
well-known example.} In an Iron-based perovskites, (DMA)Fe^{II-III}(COOH)_3,
dimethylammonium (DMA) molecules are organized in a hexagonal structure. They
are orientationally disordered at high temperatures, but order at around
$T=100$~K in a peculiar toroidal pattern. Recent experimental and theoretical
study suggest the appearance of ferroelectric polarization in this phase,
although the measured polarization is small, and the mechanism of
ferroelectricity is still debated. We formulate a Landau-type theory that
clarifies the connection between the electric polarization, molecular pattern,
and distortive modes of the inorganic lattice. We find a remarkable mechanism
of improper ferroelectricity, analogue to the trimerization process in
inorganic hexagonal ferrites and manganites, but here driven by the ordering of
organic molecules in a metal-organic framework. Our study reveals an extremely
rich phase diagram with the prediction of topological domain walls, where the
ferroelectricity arise from tripling the unit cells due to molecular ordering.
Wide domain walls with inner structure are predicted.
