In this paper we prove a general result giving the maximum and the antimaximum principles in a unitary way for linear operators of the form $L+\lambda I$, provided that 0 is an eigenvalue of L with associated constant eigenfunctions. To this purpose, we introduce a new notion of "quasi"-uniform maximum principle, named k-uniform maximum principle: it holds for lambda belonging to certain neighborhoods of 0 depending on the fixed positive multiplier k > 0 which selects the good class of right-hand-sides. Our approach is based on a $L^infinity$ - $L^p$ estimate for some related problems. As an application, we prove some generalization and new results for elliptic problems and for time periodic parabolic problems under Neumann boundary condition