How to configure an IMAP(S) client will depend on the particular client and the version of that client. There is lots of useful examples on the OUCS help web pages. If you follow these examples you will typically need to change the odd step to specify things such as the maths IMAP server and an appropriate SMTP server rather than the central university ones shown in the examples.
Incoming mail server settings
For incoming mail (i.e. reading mail) set the IMAP(S) server to imap.maths.ox.ac.uk using an SSL connection on port 993.
Outgoing mail server settings
For outgoing mail (i.e. sending mail) you need to set the SMTP server appropriately.
A mail server will typically only accept mail for sending without authentication from machines on the same domain/network as the server.
If you are within the Institute you can set the server to be smtp.maths.ox.ac.uk using port 25.
If you are within the University network but outside the Institute (e.g using the OUCS VPN service) you could use smtp.ox.ac.uk on port 25.
If you are outside of the University network then you would need to use your ISP's SMTP server, e.g. smtp.freeserve.net.
Note: a key disadvantage of unauthenticated sending is for systems that move around, e.g. laptops, as the user needs to have different settings for each location.
A key benefit of authenticated sending is the mail server knows who you are and hence can accept outgoing mail from you regardless of where you are (particularly useful for mobile systems such as laptops).
To use authenticated sending via the departmental mail server set the outgoing server to be smtp.maths.ox.ac.uk using TLS on port 587 (OR SSL on port 465, typically for older mail clients); you will be required to authenticate against the server with your Institute username and password.