Will imessage work on factory unlocked iPhone 4?

I recently ordered a factory unlocked iPhone 4 for T-Mobile, I was told it does work by a lot of people but then I read it doesn't sometimes? Which one is it… Does anyone know?

Since iMessage uses specific ports, it may be that the carrier blocks those ports in their data/internet plan, in that case iMessage may not work, however, SMS will still work (regular text messages through the carrier)