This paper is devoted to identifying an unknown source for a time-fractional diffusion equation with variable coefficients in a general bounded domain. This is an ill-posed problem. Firstly, we obtain a regularization solution by the Landweber iterative regularization method. The convergence estimates between regularization solution and exact solution are given under a priori and a posteriori regularization parameter choice rules, respectively. The convergence estimates we obtain are optimal order for any p in two parameter choice rules, i.e., it does not appear to be a saturating phenomenon. Finally, the numerical examples in the one-dimensional and two-dimensional cases show our method is feasible and effective. [ABSTRACT FROM AUTHOR]