Actually, the answer is no, technically, an iPhone does not have to be jailbroken to work with T-Mobile. It has to be unlocked. You can unlock it via jailbroken apps, or by means of hardware, as in a piggyback SIM. You do not need to jailbreak a phone to unlock it with a piggyback SIM.