It will need to run on the FE server, since this is where your device will try to connect. I'm not too sure about the BE with IMAP. I would enable it there too, for now, and maybe stop it later, as a test.
Was IMAP running before? If not, and you have just enabled it, try connecting the phone again.