Singular limits for the Riemann problem: general diffusion, relaxation, and boundary conditions