  We report magnetization measurements and magnetic resonance data for SrTiO3
doped by manganese. We show that the recently reported coexistent spin and
dipole glass (multiglass) behaviours are strongly affected by the distribution
of Mn ions between the Sr and Ti sites. Motivated by this finding we calculate
the magnetic interactions between Mn impurities of different kinds. Both LSDA+U
and many-body perturbation theory evidence that magnetic and magnetoelectric
interactions are mediated by Mn$_B^{4+}$ ions substituting for Ti. We propose
two microscopic magnetoelectric coupling mechanisms, which can be involved in
all magnetoelectric systems based on incipient ferroelectrics. In the first
one, the electric field modifies the spin susceptibility via spin-strain
coupling of Mn$_{B}^{4+}$. The second mechanism concerns Mn pairs coupled by
the position-dependent exchange interaction.
