-$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../include/init.php');
+
+/* SquirrelMail required files. */
+
+/** imap functions depend on date functions */
+include_once(SM_PATH . 'functions/date.php');
+/** form functions */
+include_once(SM_PATH . 'functions/forms.php');
+/** mime decoding */
+include_once(SM_PATH . 'functions/mime.php');
+/** url parser */
+include_once(SM_PATH . 'functions/url_parser.php');
+/** imap functions used to retrieve vcard */
+include_once(SM_PATH . 'functions/imap_general.php');
+include_once(SM_PATH . 'functions/imap_messages.php');
+
+/* globals */
+
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
+sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
+/* end globals */
+
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);