Here are a few comments that may help.
As abx explains, a good way to think about it is in terms whether or not $m$ lies in image of the map on spectra.
As you surmised, either condition of faithful flatness or integrality are sufficient,
but not necessary! For example, take $A=k[x,y]$ and the affine blow up $B=k[x,y,z]/(y-zt)$. I'll let you convince yourself that it is surjective on spectra but neither flat nor integral (think about the fibres).