It depends on what you want to do. You need to research each component and ask if it is for you. You don't need IMAP if you want to use POP, for example.
As for security you need to bone up on securing a server use a firewall, etc etc. There are plenty posts in the Security forum for that. Email is an open format. You can encrypt the contents of the email with something like pgp if you need to do something like that. SASL is another option for that.
Is your proxy configured to let the correct ports through?