If it would depend on the shape (without additional charges somewhere), you could find a volume without charges, but with non-zero total flux. You could then divide that volume into smaller parts, and you would always get at least one part with non-zero total flux, but without charges.
Maxwell's laws allow to derive ##div(E)=\rho## plus prefactors. In particular, for a very small volume, E is nearly constant. It is hard to imagine a very small volume with zero divergence inside, but non-zero total flux on its surface.