STARTTLS for IMAP server example

code snippet for starting tis in IMAP server. works with apple email client on MAC 10.9.4.