Catalyzes the addition of a glutamate residue to dihydropteroate (7,8-dihydropteroate or H2Pte) to form dihydrofolate (7,8-dihydrofolate monoglutamate or H2Pte-Glu) (PubMed:23118010). Also catalyzes successive additions of L-glutamate to tetrahydrofolate, leading to folylpolyglutamate derivatives (By similarity). Is involved in the bioactivation of the antituberculous drug para-aminosalicylic acid (PAS). Is able to use hydroxy-dihydropteroate (H2PtePAS) as substrate, which is the product formed by the action of DHPS (FolP1) on PAS, leading to hydroxy-dihydrofolate (H2PtePAS-Glu). This compound inhibits dihydrofolate reductase DHFR (DfrA), the next enzyme in the folate pathway, and thus disrupts the folate-dependent metabolic pathways. 7,8-dihydropteroate + ATP + L-glutamate = 7,8-dihydrofolate + ADP + H(+) + phosphate (6S)-5,6,7,8-tetrahydrofolyl-(gamma-L-Glu)(n) + ATP + L-glutamate = (6S)-5,6,7,8-tetrahydrofolyl-(gamma-L-Glu)(n+1) + ADP + H(+) + phosphate Binds 2 Mg(2+) ions per subunit. Cofactor biosynthesis; tetrahydrofolate biosynthesis; 7,8-dihydrofolate from 2-amino-4-hydroxy-6-hydroxymethyl-7,8-dihydropteridine diphosphate and 4-aminobenzoate: step 2/2. Cofactor biosynthesis; tetrahydrofolylpolyglutamate biosynthesis. Monomer. Is folded into two distinct domains, an N-terminal ATPase domain and a C-terminal Rossmann-fold domain, which are joined by a flexible linker. Cells lacking this gene display impaired growth. Mutations within this gene in the H2Pte binding pocket are responsible for PAS resistance in M.tuberculosis clinical isolates and laboratory strains. FolC-linked PAS resistance is mediated by altered substrate specificity that results in the failure to generate levels of H2PtePAS-Glu that are necessary to inhibit DHFR (DfrA); therefore, a blockage of PAS bioactivation causes PAS resistance. Belongs to the folylpolyglutamate synthase family.