I've tried now a couple of days to get the iPhone 3G working with my IMAP server via a custom IMAPS/SSL port: 1234 instead of 993.
Everything works fine with my Macbook, both within and outside the firewall. With the iPhone it simply does not seem to work.
Using the default port (993) everything works fine. Changing the port in Advanced settings to anything else than 993 makes the iPhone connect to the specified port but it fails on the SSL connection (traced on the IMAP server and via WireShark). The iPhone SSL connection seems to get established but the iPhone disconnects before the IMAP session starts.
Did anyone succeed in getting this to work? What could be causing this to fail?