Holmes was never really dying. His feigned illness was a ruse to induce Smith to confess to his nephew’s murder. Holmes was not infected by the little box; he has enough enemies to know that he must always examine his mail carefully before he opens it. Starving himself for three days,and the claim of the "disease's" infectious nature was to keep Watson from examining him and discovering the ruse.