In this paper we study the chemical history of low-mass star-forming (SF) galaxies in the local Universe clusters Coma, A1367, A779, and A634. The aim of this work is to search for the imprint of the environment on the chemical evolution of these galaxies. Galaxy chemical evolution is linked to the star formation history (SFH), as well as to the gas interchange with the environment, and low-mass galaxies are well known to be vulnerable systems to environmental processes affecting both these parameters. For our study we have used spectra from the SDSS-III DR8. We have examined the spectroscopic properties of SF galaxies of stellar masses 10 8 − 10 10 M ⊙ , located from the core to the cluster's outskirts. The gas-phase O/H and N/O chemical abundances have been derived using the latest empirical calibrations. We have examined the mass-metallicity relation of cluster galaxies finding well defined sequences. The slope of these sequences, for galaxies in low-mass clusters and galaxies at large cluster-centric distances, follows the predictions of recent hydrodynamic models. A flattening of this slope has been observed for galaxies located in the core of the two more massive clusters of the sample, principally in Coma, suggesting that the imprint of the cluster environment on the chemical evolution of SF galaxies should be sensitive to both the galaxy mass and the host cluster mass. The HI gas content of Coma and A1367 galaxies indicate that low-mass SF galaxies, located at the core of these clusters, have been severely affected by ram-pressure stripping. The observed mass-dependent enhancement of the metal content of low-mass galaxies in dense environments seems plausible, according to hydrodynamic simulations. This enhanced metal enrichment could be produced by the combination of effects such as wind reaccretion, due to pressure cofinement by the intracluster medium (ICM), and the truncation of gas infall, as a result of the ram-pressure stripping. Thus, the properties of the ICM should play an important role in the chemical evolution of low-mass galaxies in clusters.