I use the IMAP settings as follows (it mostly works, but sometimes messages that you delete appear again - I'm told its an imap thing with our servers rather than an iPhone thing)
Incoming Mail Server
imap.st-and.ac.uk
Outgoing Mail Server (SMTP)
remotemail.st-and.ac.uk:25
Hope this helps