Handle $wgEnableEmail = false better

Change-Id: Ieedb2d6ccaf3d004d54262a8fd635bf32d55c862