make safe output formatting generic
do a socket connection check when adding an imap server.
remove local definition of html_safe() and replace with trait