Local zeta regularization and the scalar Casimir effect IV : the case of a rectangular box