We present a class of integral domains with all finitely generated modules isomorphic to direct sums of cyclic modules. This class contains all previously known examples (i.e., the principal ideal domains and the almost maximal valuation rings) and, by an example, at least one more domain. The class consists of the integral domains satisfying (1) every finitely generated ideal is principal (obviously a necessary condition) and (2) every proper homomorphic image of the domain is linearly compact. We call an integral domain almost maximal if it satisfies (2). This is one of eleven conditions which, for valuation rings, is equivalent of E. Matlis’ “almost maximal.” An arbitrary integral domain R is almost maximal if and only if it is h-local and
R
M
{R_M}
is almost maximal for every maximal ideal M of R. Finally, equivalent conditions for a Prüfer domain to be almost maximal are studied, and in the process some conjectures of E. Matlis are answered.