Fixed NPE (ticket #1272)
Mark important comments
Enable STARTTLS for IMAP and SMTP using selfsigned certificate

Certificate domain is 127.0.0.1, clients will throw a warning if using localhost
(alongside the warning for selfsigned cert).